[Python-ideas] PEP: Dict addition and subtraction

Anders Hovmöller boxed at killingar.net
Tue Mar 5 12:02:32 EST 2019

> I'd like to remove all doubt: {**d1} needs to work regardless of the key type, as long as it's hashable  (d1 could be some mapping implemented without hashing, e.g. using a balanced tree, so that it could support unhashable keys).
> If there's doubt about this anywhere, we could add an example to the docs and to the PEP.

On a related note: **kwargs, should they support arbitrary strings as keys? I depend on this behavior in production code and all python implementations handle it.

/ Anders

More information about the Python-ideas mailing list