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 ncogh...@gmail.com 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

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 python-check...@python.org 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

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-23 Thread Nick Coghlan
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