Reading the C source code of
frozenset, I discovered that:
>>> fs = frozenset((0, )) >>> fs is frozenset(fs) True >>> fs is fs.copy() True >>> import copy >>> copy.copy(fs) is fs True
This is true for all immutable types. For example,
mytuple is mytuple[:]. I think this is useful, but it’s a bit confusing for
copy(). Honestly I expect that it will return a new equal object, not the old one.
To have a new object, you must do
I think it should be at least documented as CPython implementation detail.