Overloadable Assignment PEP

Bengt Richter bokr at oz.net
Thu Apr 3 19:29:01 EST 2003


On Thu, 03 Apr 2003 15:01:35 -0800, Erik Max Francis <max at alcyone.com> wrote:

>Lulu of the Lotus-Eaters wrote:
>
>> Then again, I wouldn't mind adding the new operator ":=" which was
>> "generic augmentation"... the operator could do -absolutely nothing-
>> for
>> standard types, but could be available for custom meaning in custom
>> types.
>
>That strikes me as a better approach; having a special "augmentation"
>operator which has no predefined meaning but can be overridden as
>desired, and thereby leaving usual assignment alone.
>
>The only reservation I might have is whether or not := is a good choice,
>simply because of the :=/= and =/== language differences out there.
>
I feel a bit reserved re the name "generic augmentation" -- how 'bout
something with "update" or "mutate" in it, so x:=y reads "update/mutate x with y"
or "x updated/mutated with y". The latter would read better if  x:=y were
an _expression_ whose value was x after the side effect.

Regards,
Bengt Richter




More information about the Python-list mailing list