Python Source Code Beautifier
alan.franzoni_invalid at geemail.invalid
Fri Mar 2 14:45:32 CET 2007
Il 28 Feb 2007 14:09:09 -0800, sjdevnull at yahoo.com ha scritto:
> Seems obvious and desirable to me. Bare "=" is the way you assign a
> name to an object; saying "NAME =" will rebind the name, breaking the
> connection between a and b. Without it, they continue to refer to the
> same object; extending the list (via += or .extend) mutates the
> object, but doesn't change which objects a and b are referencing.
Well... the main problem is not with the '+=' operators themselves, it's
with the 'global coherence'. I would assume then, that if the '+=' operator
is assumed to modify objects in-place, it would just fail on immutable
objects, wouldn't I?
I mean... I don't like that. I'm not really a Python expert, I found this
behaviour is documented in the language reference itself:
But... I don't know, still think it's confusing and not going to use it.
Alan Franzoni <alan.franzoni.xyz at gmail.com>
Togli .xyz dalla mia email per contattarmi.
Remove .xyz from my address in order to contact me.
GPG Key Fingerprint (Key ID = FE068F3E):
5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E
More information about the Python-list