Python from Wise Guy's Viewpoint

Frode Vatvedt Fjeld frodef at cs.uit.no
Sun Oct 19 09:24:18 EDT 2003


> mike420 at ziplip.com <mike420 at ziplip.com> pisze:
>
>> 8. Can you undefine a function, value, class or unimport a module?
>>    (If the answer is no to any of these questions, Python is simply
>>     not interactive enough)

Jarek Zgoda <jzgoda at gazeta.usun.pl> writes:

> Yes. By deleting a name from namespace. You better read some
> tutorial, this will save you some time.

Excuse my ignorance wrt. to Python, but to me this seems to imply that
one of these statements about functions in Python are true:

  1. Function names (strings) are resolved (looked up in the
     namespace) each time a function is called.

  2. You can't really undefine a function such that existing calls to
     the function will be affected.

Is this (i.e. one of these) correct?

-- 
Frode Vatvedt Fjeld




More information about the Python-list mailing list