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/125859.html below:

[Python-Dev] Enum: subclassing?

[Python-Dev] Enum: subclassing?Guido van Rossum guido at python.org
Thu May 2 02:11:32 CEST 2013
Yes.

On Wed, May 1, 2013 at 3:51 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> On 05/01/2013 02:07 PM, Guido van Rossum wrote:
>>
>> On Wed, May 1, 2013 at 2:04 PM, Eli Bendersky <eliben at gmail.com> wrote:
>>>
>>>
>>> class BehaviorMixin:
>>>    # bla bla
>>>
>>> class MyBehavingIntEnum(int, BehaviorMixin, Enum):
>>>    foo = 1
>>>    bar = 2
>>
>>
>> It's a common pattern to do this with a base class rather than a
>> mixin, though, and I think the rule "only allow subclassing empty
>> enums" makes a lot of sense.
>
>
> So is this a pronouncement?  I'm going to get whiplash if I change that bit
> of code many more times.  ;)
>
> --
> ~Ethan~
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/guido%40python.org



-- 
--Guido van Rossum (python.org/~guido)
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