[Python-Dev] PEP 435 - requesting pronouncement (original) (raw)
Guido van Rossum guido at python.org
Sun May 5 19:40:40 CEST 2013
- Previous message: [Python-Dev] PEP 435 - requesting pronouncement
- Next message: [Python-Dev] PEP 435 - requesting pronouncement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, May 5, 2013 at 3:05 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
I still would like to see Nick's class-based API preferred over the functional API:
class Season(Enum, members='spring summer autumn'): pass The PEP doesn't even mention it, even though you got significant pushback on the proposed getframe() hack for pickling (including mentions that IronPython and Cython may not support it), and nobody seemed to be unhappy with the class-based proposal.
This particular bikeshed has sailed.
I heard all the feedback, took into account my own thoughts, and have decided that we should go ahead with this syntax and the _getframe() hack. If the _getframe() hack doesn't work on a given platform, the module attribute is not set correctly, so pickling will fail, but everything else will work. We can work on a PEP to replace the _getframe() hack separately; I think it's functionality that is useful beyond Enum() and namedtuple(), and can be implemented on all platforms with something a lot less general than _getframe().
Authors can also avoid the _getframe() hack in two ways: (a) use the full class definition; (b) specify the full dotted class name in the call. (We should modify namedtuple() to support this too BTW.)
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] PEP 435 - requesting pronouncement
- Next message: [Python-Dev] PEP 435 - requesting pronouncement
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]