Mike, Gary, Magnus
First of all, thanks to you all for the clarifications.
On 1/14/06, Mike Meyer <[EMAIL PROTECTED]> wrote:
> Python variables are just names. They refer to (are "bound" to)
> objects. An assignment statement doesn't change a value. It rebinds
> the variable (or lvalue) to the va
Florian Daniel Otel wrote:
> 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 ?
No! The
Florian Daniel Otel wrote:
> 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
Florian Daniel Otel wrote:
> 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
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 appl
Florian Daniel Otel wrote:
>
> My problem: I just discovered (by mistake) that attempting to assign a
> value to a non-local dictionary/list member does NOT generate an "
> UnboundLocalError" exception and the assignment is preserved upon
> exiting that scope (i.e. function). This would "violate"
Hello all,
As the subject says, I am a newcomer to Python and I have a newcomer
question wrt namespaces and variable scope. Obviously, I might be
missing smth obvious, so TIA for the patience and/or pointers to
relevant resources
My problem: I just discovered (by mistake) that attempting to assig
Florian Daniel Otel wrote:
> Hello all,
>
>
> Attached are 3 small python scripts that illustrate my "problem". The
> first one uses string tuples and behaves as expected. The other two
> use dictionaries and (resp.) lists and illustrate my "problem"
>
> TIA for any pointers,
>
> Florian
>
> P.S.