Re: [Python-Dev] [Python-checkins] r87445 - python/branches/py3k/Lib/numbers.py

2010-12-27 Thread Mark Dickinson
On Fri, Dec 24, 2010 at 1:08 AM, Nick Coghlan wrote: >>     def __index__(self): >> -        """index(self)""" >> +        """someobject[self]""" >>         return int(self) > > Changing the docstring to say "operator.index(self)" would be the > clearest solution here. Agreed. Certainly "someobj

Re: [Python-Dev] [Python-checkins] r87445 - python/branches/py3k/Lib/numbers.py

2010-12-26 Thread Terry Reedy
On 12/26/2010 7:01 PM, Nick Coghlan wrote: Yes, the definition in the language reference could definitely be improved to mention the semantics first, and then reference operator.index second. Possible wording "Indicates to the Python interpreter that the object is semantically equivalent to the

Re: [Python-Dev] [Python-checkins] r87445 - python/branches/py3k/Lib/numbers.py

2010-12-26 Thread Nick Coghlan
On Mon, Dec 27, 2010 at 3:13 AM, Éric Araujo wrote: > Le 24/12/2010 02:08, Nick Coghlan a écrit : >> On Fri, Dec 24, 2010 at 4:41 AM, eric.araujo >> wrote: >>> Fix small inaccuracy: there is no index function >> >> Yes, there is, it just isn't a builtin - it lives in the operator module. > Defin

Re: [Python-Dev] [Python-checkins] r87445 - python/branches/py3k/Lib/numbers.py

2010-12-26 Thread Éric Araujo
Le 24/12/2010 02:08, Nick Coghlan a écrit : > On Fri, Dec 24, 2010 at 4:41 AM, eric.araujo > wrote: >> Fix small inaccuracy: there is no index function > > Yes, there is, it just isn't a builtin - it lives in the operator module. Defining object.__index__ with operator.index seems pretty circula

Re: [Python-Dev] [Python-checkins] r87445 - python/branches/py3k/Lib/numbers.py

2010-12-23 Thread Nick Coghlan
On Fri, Dec 24, 2010 at 4:41 AM, eric.araujo 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): > -