Newcomer question wrt variable scope/namespaces
Florian Daniel Otel
florian.otel at gmail.com
Fri Jan 13 17:38:44 EST 2006
More information about the Python-list mailing list
Fri Jan 13 17:38:44 EST 2006
- Previous message (by thread): XML vs. cPickle
- Next message (by thread): Newcomer question wrt variable scope/namespaces
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Gary, First of all, many thanks for the reply. Do I understand it correctly that actually the rule has to be refined as pertaining to the (so called) "immutable" types (like e.g. integers, tuples/strings) whereas lists and dictionaries are "mutable" types and the said scoping rule does not apply ? Thanks again, Florian On 1/13/06, Gary Duzan <gary.duzan at motorola.com> wrote: > > Right. However, assigning to a['foo'] modifies the object to which > 'a' refers, not the 'a' variable itself. The rule is limited to the > rebinding of variables, not the modification of the objects to which > they refer. > > Gary Duzan > Motorola CHS > >
- Previous message (by thread): XML vs. cPickle
- Next message (by thread): Newcomer question wrt variable scope/namespaces
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list