[Tutor] what is dynamic about "dynamic name resolution" ?
wescpy at gmail.com
Mon Jan 18 00:11:40 CET 2010
On Sun, Jan 17, 2010 at 12:10 PM, Robert <webtourist at gmail.com> wrote:
> In the Python tutorial (highlighted here http://awurl.com/N1XvzIo2Q)
> What exactly is "dynamic name resolution" ? specifically what is
> "dynamic" about it ?
what this means is that as your code is executing and the interpreter
encounters an identifier/variable, it "dynamically" looks up the
variable at that point -- it checks at that point to see if it's a
local variable; if not, global; finally it checks if it's a built-in.
to rephrase: this check is *not* done during compile time (static);
instead, it is done during runtime (dynamic). if it were static, it
would've already been checked *before* your code ever started running.
hope this helps!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
"Python Fundamentals", Prentice Hall, (c)2009
wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
More information about the Tutor