On Fri, Dec 24, 2010 at 4:41 AM, eric.araujo <python-check...@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 | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com