<div dir="ltr">On 5 May 2013 16:17, Ethan Furman <span dir="ltr"><<a href="mailto:ethan@stoneleaf.us" target="_blank">ethan@stoneleaf.us</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 05/04/2013 10:59 PM, Ethan Furman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 05/04/2013 08:50 PM, Tim Delaney wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2. Instead of directly setting the _name and _value of the enum_item, it lets the Enum class do it via Enum.__init__().<br>
</blockquote></blockquote></div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Subclasses can override this. This gives Enums a 2-phase construction just like other classes.<br>
</blockquote>
<br>
Not sure I care for this.  Enums are, at least in theory, immutable objects, and immutable objects don't call __init__.<br>
</blockquote>
<br></div>
Okay, still thinking about `value`, but as far as `name` goes, it should not be passed -- it must be the same as it was in the class definition<br></blockquote><div><br></div><div style>Agreed - name should not be passed.</div>
<div style><br></div><div style>I would have preferred to use __new__, but Enum.__new__ doesn't get called at all from enum_type (and the implementation wouldn't be at all appropriate anyway).</div><div style><br>
</div><div style>Tim Delaney </div></div></div></div>