03.12.19 07:04, Guido van Rossum пише:
Actually there's no need to optimize the |= operator -- for strings we have to optimize += *because* strings are immutable, but for dicts we would define |= as essentially an alias for .update(), just like the relationship between += and .extend() for lists, and then no unnecessary objects would be created.
Yet one question: should |= accept only dicts at right side, or arbitrary mappings with the keys() method, or even iterables of pairs as dict.update()?
And the same question for |. Should `{} | Mapping()` and `{} | []` work? _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/6DMZC2OBBOH3JWLNNW55C3SLGSFPGM67/ Code of Conduct: http://python.org/psf/codeofconduct/