Metaclasses in traitlets and PEP 487
Martin Teichmann <[email protected]>
| Newsgroups | gmane.comp.python.ipython.devel |
|---|---|
| Message-ID | <CAO9LD_B=AL9DjhDUtNUQUZ4QTb5FoHVs=P9G=YF16hcoAEBiKw@mail.gmail.com> |
Hi List, over a python-ideas, we are currently discussing PEP 487: https://www.python.org/dev/peps/pep-0487/ This proposal intends to ease the customization of class creation. Instead of using custom metaclasses the idea is to have only one metaclass in the standard library or even in Python itself. The IPython traitlets are a typical application for this proposal, and could benefit from that. This is why I converted traitlets to use a PEP 487 style metaclass and uploaded it to https://github.com/tecki/traitlets/tree/pep487 It works, all tests pass unmodified in both Python 2 and 3. Given that PEP 487 was written with projects like IPython traitlets in mind, I thought I ask on this list whether there are comments about it. As a note to the reader, following discussions on python-ideas, the naming of methods has changed a little since I last posted PEP 487, so the comments in https://github.com/tecki/traitlets/blob/pep487/traitlets/utils/metaclass.py are more accurate. I did not yet start a formal pull request, as PEP 487 is still discussed and things may still change. Greetings Martin