Skip to main content
Code Review

Return to Revisions

3 of 3
replaced http://stackoverflow.com/ with https://stackoverflow.com/

An interesting bit of code. :)

The downsides would be the things missing from enum34 1:

  • printing a variable gives no indication that it's an enum and not a string
  • enums that have the same value will compare equal
  • depending on the value of the member, is won't always work
  • etc.

Plus the surprise other developers will have when your enum doesn't work like the now-standard Python Enum2.

On the bright side, you shouldn't have any problems with pickling.


1 Disclosure: I am the author of the Python stdlib Enum, the enum34 backport, and the Advanced Enumeration (aenum) library.

2 See this answer for the standard Enum usage.

default

AltStyle によって変換されたページ (->オリジナル) /