immutables icon indicating copy to clipboard operation
immutables copied to clipboard

Make empty mapping a singleton

Open hukkin opened this issue 4 years ago • 0 comments

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

hukkin avatar Mar 11 '20 23:03 hukkin