
On Wed, Jan 19, 2022 at 11:30:36AM +1300, Greg Ewing wrote:
I'd also be happy with making frozenset a keyword.
- int, float, str, tuple, dict, set, exceptions, len, etc are not keywords, so they can be shadowed (for good or bad); - alone out of all the builtin types and functions, frozenset is a keyword. Shadowing of builtin functions is a double-edged feature. But I think that, having made the decision to make them *not* keywords, they should either *all* be keywords, or *none*. It is weird to have some of them shadowable and some of them not. None, True and False are special values, in a category of their own, so I don't think the inconsistency there is important. But having frozenset _alone_ out of the builtin functions and types a keyword would be a real Wat? moment. I know about "foolish consistency", but then there is also foolish inconsistency. If we could just make one builtin function/type a keyword, with all the optimization advantages that allows for, would we *really* choose frozenset as the most important? I don't know, the answer isn't clear to me. But it certainly wouldn't be my first choice. -- Steve