
On Sat, 22 Jan 2022 at 09:45, Steven D'Aprano <steve@pearwood.info> wrote:
On Fri, Jan 21, 2022 at 10:56:42PM +1100, Chris Angelico wrote:
Let's be fair here... The idea of freezing is to make it hashable,
And immutable.
so there's no point talking about freezing a function, module,
Neither of which are immutable.
Okay, so what would freezing a function be useful for, then? What is your use-case here? Mutable objects can't be used as dict keys, so there is a strong use-case for versions of them which can. But when arbitrary attributes don't contribute to equality, freezing becomes largely irrelevant. I can subclass frozenset and allow attributes. Do we then need a "really frozen set"? What is the point of such a protocol, given that my subclass is still hashable? Or are you just arguing for the sake of arguing? ChrisA