<div dir="ltr">Hm. But there's an implementation that has made it unscathed through several betas and an RC. AFAICT that beta pickles enums by value. And I happen to think that that is the better choice (but I don't have time to explain this gut feeling until after 3.4 has been released).<br>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 18, 2014 at 10:01 AM, Ethan Furman <span dir="ltr"><<a href="mailto:ethan@stoneleaf.us" target="_blank">ethan@stoneleaf.us</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 02/18/2014 09:47 AM, Guido van Rossum wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I'm confused. Hasn't this all been decided by the PEP long ago?<br>
</blockquote>
<br></div>
The PEP only mentions pickling briefly, as in "the normal rules apply".  How pickling occurs is an implementation detail, and it turns out that pickling by name is more robust.<br>
<br>
Serhiy, as part of his argument for using the _name_ instead of the _value_ for pickling, brought up the point that different systems could have different values for the same name.  If true in practice (and I believe it is) this raises the issue of aliases, which currently *cannot* be pickled by name because there is no distinct object for the alias.  If you ask for Color['alias_for_red'] you'll get Color.red instead.<br>


<br>
Using identity comparison was part of the PEP.<br>
<br>
I guess the question is which is more important?  Identity comparison or this (probably) rare use-case?  If we stick with identity I'm not aware of any work-around for pickling enum members that are aliases on one system, but distinct on another.<br>


<br>
I've been talking about pickling specifically, but this applies to any serialization method.<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
~Ethan~<br>
______________________________<u></u>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" target="_blank">https://mail.python.org/<u></u>mailman/options/python-dev/<u></u>guido%40python.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)
</div>