Python from Wise Guy's Viewpoint

Peter Hansen peter at engcorp.com
Sun Oct 19 15:19:14 CEST 2003


Frode Vatvedt Fjeld wrote:
> 
> > 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?

Both are correct, in essence.  (And depending on how one interprets
your second point, which is quite ambiguous.)

-Peter




More information about the Python-list mailing list