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

2016-07-20 Thread Sylvain Corlay
In any case I find this PEP great. If we can implement a library like traitlets only using these new hooks without a custom metaclass, it will be a big improvement. My only concern was that calling the hook __set_name__ was misleading while it could not set the name at all and do pretty much anyth

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

2016-07-20 Thread Guido van Rossum
Whoa. That's not how I read it. --Guido (mobile) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

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

2016-07-20 Thread Nick Coghlan
On 21 July 2016 at 03:40, Sylvain Corlay wrote: > My point is that in any real-world implementation of traits, __set_name__ > will do a lot more than setting the name, which makes the name misleading. I suspect the point of disagreement on that front may be in how we view the names of the existin

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

2016-07-20 Thread Sylvain Corlay
Hi Nick, Thank you for your reply. I understand your argument about using protocol method names that are very specific to a particular intended use case. Interestingly, the one example that is provided in the PEP is that of a "trait" which is pretty much the same as traitlets. (traitlets started

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

2016-07-20 Thread Nick Coghlan
Hi Sylvain, Thanks for getting in touch! The traitlets library sounds interesting, and provides good additional evidence that this is a capability that folks are interested in having available. On 20 July 2016 at 15:26, Sylvain Corlay wrote: > My understanding is that the proposed __set_name__ i