[Python-Dev] PEP 3121, 384 Refactoring Issues (original) (raw)

Stefan Krah stefan at bytereef.org
Fri Jul 11 13:46:27 CEST 2014


Brett Cannon <brett at python.org> wrote:

No, the PEPs were fine and were accepted properly. A huge portion of the open issues are from Robin Schreiber who as part of GSoC 2012 -- https:// www.google-melange.com/gsoc/project/details/google/gsoc2012/robinhood/ 5668600916475904 -- went through and updated the stdlib to follow the new practices introduced in the two PEPs. Not sure if there was some policy decision made that updating the code wasn't worth it or people simply didn't get around to applying the patches.

Due to the frequent state lookups there is a performance problem though, which is quite significant for _decimal. Otherwise I think I would have implemented the changes already.

http://bugs.python.org/issue15722

I think for speed sensitive applications it may be an idea to create a new C function (METH_STATE flag) which gets the state passed in by ceval.

Other than that, looking up the state inside the module but cache it (like it's done for the _decimal context) also has reasonable performance.

Also I hit the same issues that Eli mentioned here a while ago:

https://mail.python.org/pipermail/python-dev/2013-August/127862.html

Stefan Krah



More information about the Python-Dev mailing list