Relax Syntax for Augmented Arithmetic?
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Sun Jan 18 07:40:55 EST 2009
On Sun, 18 Jan 2009 04:24:04 -0800, andrew cooke wrote:
> my argument was that *= is not treated as = and *, but as a completely
> new operator (the docs even say that the implementation need not return
> self which suggests some pretty extreme semantics were envisaged).
What do you mean by "suggests … extreme semantics"? Most natural thing
is to use numbers and there you *have* to be able to return something
different than `self` to get anything useful. For instance:
n *= 3
with `n` bound to a number different from zero can't return `self` from
`__imul__`.
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list