This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients brandtbucher, gvanrossum, rhettinger, serhiy.storchaka, xtreak
Date 2019-02-28.07:52:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551340326.74.0.909745187914.issue36144@roundup.psfhosted.org>
In-reply-to
Content
> * It is natural to expect the plus operator to be commutative, but this operation would necessarily be non-commutative.

In Python, the plus operator for sequences (strings, lists, tuples) is non-commutative.

But I have other arguments against it:

* It conflicts with the plus operator of Counter (which is a specialized dict): Counter(a=2) + Counter(a=3) == Counter(a=5), but the proposed idea makes dict(a=2) + dict(a=3) == dict(a=3).

* We already have a syntax for dict merging: {**d1, **d2}. It works with arbitrary mappings, in contrary to the plus operator, which needs a special support in argument types.
History
Date User Action Args
2019-02-28 07:52:06serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, rhettinger, xtreak, brandtbucher
2019-02-28 07:52:06serhiy.storchakasetmessageid: <1551340326.74.0.909745187914.issue36144@roundup.psfhosted.org>
2019-02-28 07:52:06serhiy.storchakalinkissue36144 messages
2019-02-28 07:52:06serhiy.storchakacreate