def newest_slice(iterable, count):
 if (count < (-1)):
  raise ValueError("count can't be smaller than -1!")
 elif (count == 0):
  return []
 elif ((count == (-1)) or (len(iterable) < count)):
  return iterable
 else:
  return itertools.islice(iterable, (len(iterable) - count), len(iterable))

def newest_slice ( iterable , count ) : if ( count < ( - 1 ) ) : raise ValueError ( "count can't be smaller than -1!" ) elif ( count == 0 ) : return [ ] elif ( ( count == ( - 1 ) ) or ( len ( iterable ) < count ) ) : return iterable else : return itertools . islice ( iterable , ( len ( iterable ) - count ) , len ( iterable ) )
get an iterable for the n newest items of the given iterable .