Why operations between dict views return a set and not a frozenset?

Marco Sulla Marco.Sulla.Python at gmail.com
Tue Jan 4 13:27:31 EST 2022


$ python
Python 3.10.0 (heads/3.10-dirty:f6e8b80d20, Nov 18 2021, 19:16:18)
[GCC 10.1.1 20200718] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {1:2}
>>> c = {1:2, 3:4}
>>> c.keys() - a.keys()
{3}
>>>


Why not frozenset({3})?


More information about the Python-list mailing list