Python from Wise Guy's Viewpoint
Frode Vatvedt Fjeld
frodef at cs.uit.no
Sun Oct 19 09:47:26 EDT 2003
Peter Hansen <peter at engcorp.com> writes:
> Both are correct, in essence. (And depending on how one interprets
> your second point, which is quite ambiguous.)
Frode Vatvedt Fjeld wrote:
>> 1. Function names (strings) are resolved (looked up in the
>> namespace) each time a function is called.
But this implies a rather enormous overhead in calling a function,
doesn't it?
>> 2. You can't really undefine a function such that existing calls to
>> the function will be affected.
What I meant was that if you do the following, in sequence:
a. Define function foo.
b. Define function bar, that calls function foo.
c. Undefine function foo
Now, if you call function bar, will you get a "undefined function"
exception? But if point 1. really is true, I'd expect you get a
"undefined name" execption or somesuch.
--
Frode Vatvedt Fjeld
More information about the Python-list
mailing list