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 vstinner
Recipients Arfrever, christian.heimes, skrah, vstinner, zach.ware
Date 2013-10-28.21:18:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382995108.54.0.0424692776812.issue19229@psf.upfronthosting.co.za>
In-reply-to
Content
> Another option is to add a _pyoperator module.

Attached builtin_operator.patch patch implements this option: operator.c becomes the main operator module, _pyoperator is the pure Python implementation (don't use "from _operator import *" anymore).

With the patch:

$ ./python -m timeit "import sys; modname='_pyoperator'" "__import__(modname); del sys.modules[modname]" 
1000 loops, best of 3: 276 usec per loop

$ ./python -m timeit "import sys; modname='operator'" "__import__(modname); del sys.modules[modname]" 
10000 loops, best of 3: 22.7 usec per loop


The patch is huge because files are renamed: see builtin_operator_diff.patch for the diff.
History
Date User Action Args
2013-10-28 21:18:30vstinnersetrecipients: + vstinner, christian.heimes, Arfrever, skrah, zach.ware
2013-10-28 21:18:28vstinnersetmessageid: <1382995108.54.0.0424692776812.issue19229@psf.upfronthosting.co.za>
2013-10-28 21:18:28vstinnerlinkissue19229 messages
2013-10-28 21:18:28vstinnercreate