having both dynamic and static variables

Gregory Ewing greg.ewing at canterbury.ac.nz
Sat Mar 5 19:51:59 EST 2011


BartC wrote:

> I got the impression the OP was talking about simply pinning down 
> certain variables, so that a runtime name lookup (if that's in fact what 
> Python does) was not necessary.

A problem with this is that lexical name lookups are a
relatively small proportion of the looking up that goes
on in a typical Python program. Much more often you're
looking up attributes of objects, which is much harder
to turn into an indexed access, because the compiler
has next to no knowledge of what type the object will
be at run time.

-- 
Greg



More information about the Python-list mailing list