A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-May/125837.html below:

[Python-Dev] Enum: subclassing?

[Python-Dev] Enum: subclassing? [Python-Dev] Enum: subclassing?Antoine Pitrou solipsis at pitrou.net
Wed May 1 23:00:01 CEST 2013
On Wed, 1 May 2013 13:57:11 -0700
Eli Bendersky <eliben at gmail.com> wrote:
> 
> I still don't understand what you mean, sorry. Like, this:
> 
> class MyEmptyEnum(Enum):
>   pass
> 
> Why would you want to subclass MyEmptyEnum ?
> 
> Or do you mean this:
> 
> class IntEnum(int, Enum):
>   pass
> 
> Now I can have:
> 
> class SocketFamily(IntEnum):
>   ??
> 
> If it's the latter, then why allow subclassing explicitly just for this
> reason?

Because I may want to share methods accross all concrete subclasses of
IntEnum (or WhateverEnum).

Regards

Antoine.
More information about the Python-Dev mailing list

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