Re: [Python-Dev] PEP487: Simpler customization of class creation

2016-07-29 Thread Ethan Furman
On 07/29/2016 08:01 AM, Martin Teichmann wrote: ... Also, while researching other people's code when I wrote PEP 487, I couldn't find any such code elsewhere, yet I found a lot of code where people took the wildest measure to prevent a metaclass in doing its job on the first class it is used

[Python-Dev] Method signatures in the datetime module documentation

2016-07-29 Thread Alexander Belopolsky
I have started [1] writing documentation for the new PEP 495 (Local Time Disambiguation) features and ran into the following problem. The current documentation is rather inconsistent in presenting the method signatures. For example: date.replace(year, month, day) [2], but

Re: [Python-Dev] PEP487: Simpler customization of class creation

2016-07-29 Thread Martin Teichmann
Hi Sylvain, thanks for the example, it's a great example to illustrate PEP 487 and its design decisions. > What it does is setting some class attributes that are required for certain > types of descriptors to be able to initialize themselves. > > class MetaHasTraits(MetaHasDescriptors): > >

[Python-Dev] Summary of Python tracker Issues

2016-07-29 Thread Python tracker
ACTIVITY SUMMARY (2016-07-22 - 2016-07-29) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open5588 ( +2) closed 33818 (+56) total 39406 (+58) Open issues

Re: [Python-Dev] PEP487: Simpler customization of class creation

2016-07-29 Thread Sylvain Corlay
In the traitlets library I mentioned earlier, we do have a need for this. The corresponding function is called `setup_class`. What it does is setting some class attributes that are required for certain types of descriptors to be able to initialize themselves. class

Re: [Python-Dev] PEP487: Simpler customization of class creation

2016-07-29 Thread Martin Teichmann
Hello, there has been quite some discussion on why PEP 487's __init_subclass__ initializes subclasses, and not the class itself. I think the most important details have been already thoroughly discussed here. One thing I was missing in the discussion is practical examples. I have been using PEP