|  [ Raymond Hettinger ]:
|  > If someone really cared about the double lookup, they could
|  > flatten a level by starting their modules with:
|  > 
|  >    from __builtin__ import *
|  > 
|  > However, we don't see people writing this kind of code.  That
|  > could mean that the double lookup hasn't been a big concern.


[ Steven Elliott <[EMAIL PROTECTED]> ]:
----------------------------------------
|  It could mean that.  I think what you are suggesting is sufficiently
|  cleaver that the average Python coder may not have thought of it.
| 
|  # small cut 
|
| And the "from __builtin__  import *" additionally imposes a startup
| cost and memory cost (at least a word per builtin, I would guess).

I suppose that if someone decided to use "from __builtin__  import *"
to avoid double lookup, this person *knows* what builtins should be
optmized, and therefore could use  import specific builtins
"from __builtin__ import len, max" avoiding a startup/memory penalty.
Otherwise, the startup/memory penalty might be non-issues.

cheers,
Rod Senra
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to