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

[Python-Dev] PEP 435 - reference implementation discussion

[Python-Dev] PEP 435 - reference implementation discussion [Python-Dev] PEP 435 - reference implementation discussionEthan Furman ethan at stoneleaf.us
Sun May 5 07:59:38 CEST 2013
On 05/04/2013 08:50 PM, Tim Delaney wrote:
>
> Think I've come up with a system that works for my auto-numbering case without knowing the internals of enum_type. Patch
> passes all existing test cases. The patch does two things:
>
> 1. Finds the first non-Enum class on the MRO of the new class and uses that as the enum type.

This is good.  :)


> 2. Instead of directly setting the _name and _value of the enum_item, it lets the Enum class do it via Enum.__init__().
> Subclasses can override this. This gives Enums a 2-phase construction just like other classes.

Not sure I care for this.  Enums are, at least in theory, immutable objects, and immutable objects don't call __init__.

Of course, practicality beats purity... I'll have to think about this some more.

Fortunately, none of this has any bearing on the PEP itself.

--
~Ethan~
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