On Fri, Dec 24, 2010 at 4:41 AM, eric.araujo <python-checkins at python.org> wrote: > Author: eric.araujo > Date: Thu Dec 23 19:41:33 2010 > New Revision: 87445 > > Log: > Fix small inaccuracy: there is no index function Yes, there is, it just isn't a builtin - it lives in the operator module. > def __index__(self): > - """index(self)""" > + """someobject[self]""" > return int(self) Changing the docstring to say "operator.index(self)" would be the clearest solution here. (Choosing to accept arbitrary index objects as integer equivalents is up to the object being indexed, just like interpreting slices is - a dict, for example, will never invoke __index__ methods). Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4