Performance of list comprehensions vs. map

Chris Barker chrishbarker at home.net
Fri Sep 7 18:33:24 EDT 2001


Tim Peters wrote:
> > One more question: is it possible for a function to be
> > mutable??
> func_code has been writable for some time.  Here under 2.2a3:
> 
> >>> def f():
> ...     pass
> ...
> >>> def g():
> ...     return 666
> ...
> >>> f.func_code = g.func_code
> >>> f()
> 666

YOW!

this really makes optimizing even harder than I thought, and I always
thought it was hard.

Thanks, folks, I know I've learned a lot.

-Chris



-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------



More information about the Python-list mailing list