On Fri, Jun 22, 2007 at 01:32:42PM -0600, Neil Toronto wrote:
> > (imap is faster in this case because the built-in name 'abs' is looked
> > up only once -- in the genexp, it's looked up each time, sigh --
> > possibly the biggest "we should REALLY tweak the language to let this
> > be optimized sensibly" gotcha in Python, IMHO).
> 
> What is it about the language as it stands that requires abs() to be 
> looked up each iteration?

Calling abs() could change locals()['abs'], in which case a different
function would be called the next time through.  You lookup 'abs' each
time just in case it's changed.

-- 
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to