mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
parent
ecfeb7f095
commit
70a6b49821
246 changed files with 926 additions and 962 deletions
|
@ -34,9 +34,9 @@ class Range:
|
|||
self.step = step
|
||||
self.len = max(0, int((self.stop - self.start) / self.step))
|
||||
|
||||
# implement `x` and is also used by print x
|
||||
# implement repr(x) and is also used by print x
|
||||
def __repr__(self):
|
||||
return 'range' + `self.start, self.stop, self.step`
|
||||
return 'range(%r, %r, %r)' % (self.start, self.stop, self.step)
|
||||
|
||||
# implement len(x)
|
||||
def __len__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue