[Python-ideas] Dict joining using + and +=
levkivskyi at gmail.com
Fri Mar 1 09:19:08 EST 2019
On Fri, 1 Mar 2019 at 13:48, INADA Naoki <songofacandy at gmail.com> wrote:
> > Is that an invariant you expect to apply to other uses of the +
> > operator?
> > py> x = -1
> > py> x <= (x + x)
> > False
> > py>  <= ([1, 2, 3] + )
> > False
> Please calm down. I meant each type implements "sum"
> in semantics of the type, in lossless way.
> What "lossless" means is changed by the semantics of the type.
> -1 + -1 = -2 is sum in numerical semantics. There are no loss.
TBH I don't understand what is lossless about numeric addition. What is the
definition of lossless?
Clearly some information is lost, since you can't uniquely restore two
numbers you add from the result.
Unless you define what lossless means, there will be just more
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas