I just wanted to mention this since it hasn't been brought up, but neither
of these work

a.keys() + b.keys()
a.values() + b.values()
a.items() + b.items()

However, the following do work:

a.keys() | b.keys()
a.items() | b.items()

Perhaps they work by coincidence (being set types), but I think it's worth
bringing up, since a naive/natural Python implementation of dict
addition/union would possibly involve the |-operator.

Pål
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to