<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 30 Oct 2018 at 22:33, Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">julien tayon wrote:<br>
> like the + of [] could be the + of "RecordAlgebrae"<br>
<br>
If you're proposing to change the behaviour of '+' on the<br>
built-in list type, that's not going to happen.<br>
<br></blockquote><div>I dont suggest to change something that already exists and works (I am pretty conservative too, and expect stuff to not be broken by any changes)</div><div>And all behaviours can coexists quite peacefully.<br></div><div><br></div><div>"RecordAlgebra"<br></div><div> In [5]: [2] + [2] <br>Out[5]: [2, 2]<br>In [6]: [2] * 2<br>Out[6]: [2, 2]<br>In [7]: "a" + "a"<br>Out[7]: 'aa'<br>In [8]: "a" * 2<br>Out[8]: 'aa'<br></div><div>(adding n times the same value is equal to multiplying by n // that is totally consistent to me)<br></div><div><br></div><div>Mixed scenario :</div><div>In [12]: a= mdict(a=[2], b='a')<br>In [13]: a+a<br>Out[14]: {'a': [2, 2], b='aa'}<br>In [17]: a * 4<br>Out[17]: {'a': [2, 2, 2, 2], b='aaaa'}<br></div><div>I propose the operators to be propagated, and any value to still follow its logic.</div><div>LibearAlgebraic MutableMapping would be as algebraic as their values. No more.<br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br>
Greg<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div></div></div></div></div></div>