Message194966
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 |
|
Date |
User |
Action |
Args |
2013-08-12 14:09:38 | mark.dickinson | set | recipients:
+ mark.dickinson, zach.ware |
2013-08-12 14:09:38 | mark.dickinson | set | messageid: <1376316578.03.0.462256957334.issue18712@psf.upfronthosting.co.za> |
2013-08-12 14:09:37 | mark.dickinson | link | issue18712 messages |
2013-08-12 14:09:37 | mark.dickinson | create | |
|