[Python-Dev] PEP 435: pickling enums created with the functional API (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Wed May 8 12:29:29 CEST 2013
- Previous message: [Python-Dev] PEP 435: pickling enums created with the functional API
- Next message: [Python-Dev] PEP 435: pickling enums created with the functional API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 8 May 2013 01:26, "Antoine Pitrou" <solipsis at pitrou.net> wrote:
Le Wed, 8 May 2013 01:03:38 +1000, Nick Coghlan <ncoghlan at gmail.com> a écrit : > > What if there was a variant of the class statement that bound the > result of a function call rather than using the normal syntax: > > class Animal from enum.Enum(members="dog cat bear") Apparently you're trying hard to invent syntaxes just to avoid subclassing.
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:
- use the class syntax; or
- pass a fully qualified name.
The fragile getframe hack should not be propagated beyond namedtuple.
Cheers, Nick.
Regards Antoine.
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130508/a61a3340/attachment.html>
- Previous message: [Python-Dev] PEP 435: pickling enums created with the functional API
- Next message: [Python-Dev] PEP 435: pickling enums created with the functional API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]