newbie needs help on dictionary

Olaf Appelt tholap at compuserve.com
Fri Dec 10 15:32:52 EST 1999


> > 'count' is not a copy of 'turret[station][tool_name]', it's a reference.
> > So the following should result in the same thing:
>
> nope.
>
> > > count = turret[station][tool_name]
>
> after this statement, "count" is a reference.
>
> > > count = count + 1
>
> but after this statement, "count" is rebound to
> point to a newly created integer object.  the
> dictionary still points to the *original* value.

I see.

Thanks for the correction.


Olaf






More information about the Python-list mailing list