On 02/05/13 13:47, Steven D'Aprano wrote: > The most obvious use-case for subclassing enums is to extend them: > > class Directions(Enum): > north = 1 > east = 2 > west = 3 > south = 4 > > class Directions3D(Directions): > up = 5 > down = 6 It doesn't necessarily follow that subclassing is the right mechanism for extending enums, though. If anything, you really want to "superclass" them. Maybe class Directions3D(Enum, extends = Directions): up = 5 down = 6 Then we could have issubclass(Directions, Directions3D) rather than the reverse. -- Greg
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4