Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
title='Add enum() example for named tuples'updated_at=<Date2008-03-29.09:58:02.668>user='https://bugs.python.org/calvin'
The motivation for this patch is that documenting a single function
adding enum-like capabilities would hopefully eliminate the numerous
"enum" recipies already out there, each handling things a little different.
Thanks for asking. This should not go into the collections module.
The concept makes more sense in statically compiled languages. In
Python, we typically write something like "RED, ORANGE, YELLOW = range
(3)" at the module level. That is faster and still allows prefixing
using the module name (for example, re.MULTILINE).