Performance of list comprehensions vs. map

Skip Montanaro skip at pobox.com
Fri Sep 7 16:33:13 EDT 2001


    Chris> One more question: is it possible for a function to be mutable??

Yes, in theory, from C code.  You could create a new code object and change
the function's func_code attribute.  I don't think you can do that from
Python code, even using the new module.  My rattlesnake stuff purports to do
just that.  It generates a new code object that uses the rattlesnake VM and
replaces the function's old code object with it.  For the purposes of
testing, I am currently using a setcode builtin function written by Vladimir
Marangazov so that I can swap a function's code object from Python.

but-then-just-about-anything's-possible-in-C-ly y'rs,

Skip




More information about the Python-list mailing list