
Jan. 16, 2022
2:47 p.m.
On Sun, Jan 16, 2022 at 04:50:40PM +0000, MRAB wrote:
Not quite as bad as that:
f = frozenset({1, 2, 3}) f is frozenset(f) True
Mark suggested that on the bug tracker too, but that's not relevant. As I replied there:
def f(): ... return frozenset({1, 2, 3}) ... a = f.__code__.co_consts[1] a frozenset({1, 2, 3}) b = f() assert a == b a is b False
Each time you call the function, you get a distinct frozenset object. -- Steve