[Python-Dev] r87445 - python/branches/py3k/Lib/numbers.py
"Martin v. Löwis"
martin at v.loewis.de
Thu Dec 23 23:09:28 CET 2010
Am 23.12.2010 22:09, schrieb Éric Araujo:
> Le 23/12/2010 20:55, Antoine Pitrou a écrit :
>>> def __index__(self):
>>> - """index(self)"""
>>> + """someobject[self]"""
>> This is misleading as to what the method actually does,
> Really? Unless I misunderstood the docs, __index__ is used when the
> object is used as an index (or with bin or oct, but I didn’t want to
> complicate the docstring, just fix it).
In case Antoine's objection isn't clear yet: __index__ does *not*
perform the actual indexing, as opposed to what the docstring suggests.
More information about the Python-Dev