immutables
immutables copied to clipboard
Make empty mapping a singleton
We might want to consider making the same optimization for empty mappings that CPython does for the builtin immutable types tuple
and frozenset
: make the empty mapping a singleton.
For reference, consider:
tuple() is tuple()
# True
frozenset() is frozenset()
# True
import immutables
immutables.Map() is immutables.Map()
# False