Transitivity and direction of "binding" (was Re: Comments requested: brief summary of Python)
Christopher A. Craig
list-python at ccraig.org
Wed Feb 25 08:58:00 EST 2004
Michael Hudson <mwh at python.net> writes:
> > Why?
>
> A name has zero or one bindings, but an object may have an arbitrary
> number of bindings to it.
>
Additionally if you run the function 'def t(): a+=1' you get an
UnboundLocalError, indicating that the local name "a" is not bound to
any object.
So there you have it, definitive proof from the interpreter itself.
<.9 wink>
--
Christopher A. Craig <list-python at ccraig.org>
Perl is like Vice Grips; You can do anything with it but it is the wrong tool
for every job. -- Bruce Eckel
More information about the Python-list
mailing list