This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, zach.ware
Date 2013-08-12.14:09:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376316578.03.0.462256957334.issue18712@psf.upfronthosting.co.za>
In-reply-to
Content
Nitpick: the pure Python version of operator.index (new in Python 3.4, introduced in issue #16694) doesn't match the C version, in that it looks up __index__ on the object rather than the class.


iwasawa:cpython mdickinson$ ./python.exe
Python 3.4.0a1+ (default:9e61563edb67+, Aug 12 2013, 14:45:12) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from test import support
>>> py_operator = support.import_fresh_module('operator', blocked=['_operator'])
>>> c_operator = support.import_fresh_module('operator', fresh=['_operator'])
>>> class A(int): pass
... 
>>> a = A(42); a.__index__ = lambda: 1729
>>> 
>>> py_operator.index(a)
1729
>>> c_operator.index(a)
42
History
Date User Action Args
2013-08-12 14:09:38mark.dickinsonsetrecipients: + mark.dickinson, zach.ware
2013-08-12 14:09:38mark.dickinsonsetmessageid: <1376316578.03.0.462256957334.issue18712@psf.upfronthosting.co.za>
2013-08-12 14:09:37mark.dickinsonlinkissue18712 messages
2013-08-12 14:09:37mark.dickinsoncreate