Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

As Steven have noted the compiler-time optimization is not applicable here 
because name frozenset is resolved at run-time.

In these cases where a set of constants can be replaced with a frozenset of 
constants (in "x in {1,2,3}" and in "for x in {1,2,3}") the compiler does it.

And I don't think there is an issue which is worth changing the language. 
Creating a frozenset of constants is pretty rare, and it is even more rare in 
tight loops. The most common cases (which are pretty rare anyway) are already 
covered.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46393>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to