Is there no way to optimize the byte code without adding to the language?
Not that it’s a bad idea anyway, but I wonder if frozen sets are common enough to warrant a change.
Are there any performance advantages to a frozen set? I ask because I do often use sets that could be frozen, but don’t need to be. E.g. they don’t change, nor are they used as keys.
For example:
If flag in {‘the’, ‘allowable’, ‘flags’}:
…
If a frozen set was even a little bit faster or used less memory, it would be nice to be able to create one directly.
-CHB
--
Christopher Barker, PhD (Chris)
Python Language Consulting
- Teaching
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython