Article 5FRK9 [$] Extending Python's enums

[$] Extending Python's enums

by
jake
from LWN.net on (#5FRK9)
Enumerated types or "enums" are a feature of many languages, includingPython; enums provide a convenient way to collect up a bunch of relatedsymbols that (typically) evaluate to integer values. The canonical examplewould seem to be for colors, at least for demonstration purposes, but there areothers, especially for handling "magic" constants from source likes POSIXor the host operating system. A recent thread on the python-ideas mailing list discussesdifferent ways to add a new feature to enums-seven years after they wereadded to the standard library as part ofPython 3.4.
External Content
Source RSS or Atom Feed
Feed Location http://lwn.net/headlines/rss
Feed Title LWN.net
Feed Link https://lwn.net/
Reply 0 comments