question about dictionary type..

Terry Reedy tjreedy at udel.edu
Sat Sep 14 11:58:58 EDT 2002


> Interesting is the line "start[key] = start = {}", because first
> "start[key] = {}" is evaluated, then "start = {}" (with "{}" being
the
> same object as in the first assignment). You can check this with
"dis", as
> I've read in another posting in this newsgroup:

Since this is documented in Ref Manual 6.3

"An assignment statement evaluates the expression list (remember that
this can be a single expression or a comma-separated list, the latter
yielding a tuple) and assigns the single resulting object to each of
the target lists, from left to right."

you can count on this behaviour persisting in future versions.

TJR








More information about the Python-list mailing list