[Python-Dev] Possible optimization for LOAD_FAST ? (original) (raw)

Guido van Rossum guido at python.org
Wed Jan 5 00:39:49 CET 2011


On Tue, Jan 4, 2011 at 3:36 PM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:

The only examples I could find from a quick search (using the patch decorator from my mock module which is reasonably well used) patch builtins.open and rawinput.

https://www.google.com/codesearch?hl=en&lr=&q=%22patch%28%27_builtin_.%22+lang%3Apython+case%3Ayes

So, that significantly weakens the argument that this optimization will break unit tests, since I am happy to promise never to optimize these builtins, and any other builtins intended for I/O.

Surely it will break somebody's code. That hasn't stopped us with other changes. The crux is whether it breaks significant amounts of code or code that would be really hard to write in another way.

-- --Guido van Rossum (python.org/~guido)



More information about the Python-Dev mailing list