PEP 841: Adding Frozen Syntax to Make Immutable Types Optimizable

The fact that this is narrowed down to minimal incision is IMO a positive.

However, I don’t agree that it is thinking in such a small scope.

When I wrote my initial suggestion, I was primarily thinking about how to cover all 6 base types in consistent manner in terms of convenience and performance.

So that people can use the most theoretically appropriate type instead of finding edge cases where some counterpart is faster / more convenient and using the wrong type.

Yes, it is not a massively pervasive innovation, but I think it has a good balance of impact and orthogonality.


Other improvements, such as optimizations on builtin function and method calls can be tackled independently.

I think the comment regarding small scope would be more applicable to len(string_literal) optimization. I think there might exist a generic way to trace whether called function/method is builtin at runtime and go via fastpath. is is blazing fast in C