generator expressions: performance anomaly?

Robert Brewer fumanchu at amor.org
Tue Jan 18 15:59:07 EST 2005


Jeremy Bowers wrote:
> On Tue, 18 Jan 2005 14:05:15 +0000, Antoon Pardon wrote:
> > I don't see how generating byte code for a = 9; when seeing the
> > expression a = 3 + 6, would be a problem for non-functional
> > languages.
> 
> Ultimately, the use is fairly limited; I can't imagine the 
> execution time saved would reach the time of implementation
> for weeks after a release, even aggregating across all Python
> use in the world, and "real time gained" (i.e., time useful
> to a human) would probably never add up to the
> implementation time. So why bother? That's a horrid trade off 
> when there are so many other real gains to be had.

Especially since you can already do it explicitly with Raymond
Hettinger's cookbook recipe:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org



More information about the Python-list mailing list