[Python-Dev] Enumeration items: type(EnumClass.item) is EnumClass ? (original) (raw)

Serhiy Storchaka storchaka at gmail.com
Mon Apr 29 21:15:38 CEST 2013


29.04.13 21:14, Glenn Linderman написав(ла):

1) Enum could be subclassed to provide different, sharable, types of behaviors, then further subclassed to provide a number of distinct sets of values with those behaviors.

You can use a multiclass inheritance for this.

2) Enum could be subclassed to provide one set of values, and then further subclassed to provide a number a distinct sets of behaviors for those sets of values.

How is it possible? You haven't any instance of subclass.



More information about the Python-Dev mailing list