<p dir="ltr"><br>
On 8 May 2013 01:26, "Antoine Pitrou" <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br>
><br>
> Le Wed, 8 May 2013 01:03:38 +1000,<br>
> Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> a écrit :<br>
> ><br>
> > What if there was a variant of the class statement that bound the<br>
> > result of a function call rather than using the normal syntax:<br>
> ><br>
> >     class Animal from enum.Enum(members="dog cat bear")<br>
><br>
> Apparently you're trying hard to invent syntaxes just to avoid<br>
> subclassing.</p>
<p dir="ltr">Yeah, just accepting an auto-numbered "members" arg still seems cleaner to me. If we decouple autonumbering from using the functional API, then the rules for pickle support are simple:<br>
* use the class syntax; or<br>
* pass a fully qualified name.</p>
<p dir="ltr">The fragile getframe hack should not be propagated beyond namedtuple. </p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> Regards<br>
><br>
> Antoine.<br>
><br>
><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>