def __repr__(self): """implement repr(x) which is also used by print""" return 'range(%r, %r, %r)' % (self.start, self.stop, self.step)