One last shot at the Augmented Assignment PEP
Grant Edwards
ge at nowhere.none
Thu Sep 14 13:58:12 EDT 2000
In article <8pous80tul at news1.newsguy.com>, Alex Martelli wrote:
>Without the polymorphism over mutable objects wrt immutable
>ones, += and its ilk would be mere syntactic sugar of no big
>real interest. WITH the polymorphism, they become a precious
>innovation. Call them "mutation-suggestors with fallback to
>rebinding if the object is immutable", if you wish, because
>that is what they are.
This leads into the an new field:
programming via suggestions and hints
I suppose if you really want assignment you can do it
explicitly with the old syntax. If you know that you really
want mutation, you can use the method call to make it explicit.
That way you get the proper error if you try to mutate an
immutable object.
--
Grant Edwards grante Yow! My FAVORITE group
at is "QUESTION MARK & THE
visi.com MYSTERIANS"...
More information about the Python-list
mailing list