<p dir="ltr"><br>
On 4 May 2013 09:34, "Guido van Rossum" <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
><br>
> On Fri, May 3, 2013 at 4:08 PM, Greg Ewing <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:<br>
> > Guido van Rossum wrote:<br>
> >><br>
> >> I haven't seen code in the style that<br>
> >> Greg proposes in decades,<br>
><br>
> > What style are you talking about here?<br>
><br>
> Code that wants to validate a string the user typed as input. Web<br>
> forms just don't work that way. (Command-line flags are a special<br>
> case, and there are a slew of specialized parsers for that case.)</p>
<p dir="ltr">And for code that really needs it, it is straightforward to use dir(MyEnum) and isinstance(obj, MyEnum) to get an exact mapping of names to values that also accounts for aliases.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> --<br>
> --Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)<br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/python-dev">http://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">http://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>