Serhiy Storchaka wrote:
And this opens a non-easy problem: how to create a mapping of the same type?

That's the responsibility of the class implementing the + operator.

There doesn't have to be any guarantee that a subclass of it will
automatically return an instance of the subclass (many existing
types provide no such guarantee, e.g. + on strings), so whatever
strategy it uses doesn't have to be part of its public API.

--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to