Le Wed, 13 Feb 2013 17:28:09 -0500,
Barry Warsaw
On Feb 13, 2013, at 08:30 PM, Antoine Pitrou wrote:
The cost is not low when you have many values. Also, with many values and one value per line, it can make your declaration very long vertically.
And it's not always true that you use an enum much more often than you define it. For example, you may define many error codes (e.g. errnos) for compatibility with another system, but only check a few of them explicitly in your application code.
Huge enums haven't been common in my experience, but in that case I'd probably just use the make() helper.
One of my common use cases for wanting an enum has always been to map a third-party protocol or library's error codes. Really, the one screaming use case in the stdlib is in the errno module :-) For that you have to be able to define an enum that subclasses int, though. Regards Antoine.