The two most-often missed language features from Python are enums and switches. Recently, there seem to be a new crop of recipes at the Python Cookbook for implementing these. These two seem pretty good:
These are interesting for a few reasons: first, you can use them if you want to have enums or switches at your disposal in your Python code. Second, reading them and understanding how they are constructed usually provides a mini-tutorial in some dark corner of Python semantics. And third, the debate that springs up around them is usually rich in programming language philosophy and implementation topics.
Comments
Add a comment: