[issue27366] PEP487: Simpler customization of class creation

2016-08-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 545bfa4c20eb by Victor Stinner in branch 'default': Issue #27366: Fix init_subclass() https://hg.python.org/cpython/rev/545bfa4c20eb -- ___ Python tracker

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: The new porting note doesn't quite capture all the subtleties of the situation, but should be sufficient for folks to get any affected custom metaclasses working again (since the key is to avoid passing those parameters up to type.__new__). I also added a note

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 313e8fdb0d0c by Nick Coghlan in branch 'default': Issue 27366: PEP 487 docs updates https://hg.python.org/cpython/rev/313e8fdb0d0c -- ___ Python tracker

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: D'oh, another good catch Emanuel - and I'm even the one that raised the need to mention that in the Porting notes during the python-dev discussion :P I'll post an update to the What's New shortly. -- stage: resolved -> needs patch

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Emanuel Barry
Emanuel Barry added the comment: Hello Martin, and thank you for your patch! However, this patch removed the ability to pass keyword arguments to `type`, and it's not documented anywhere. I believe it should be documented at least in e.g. the "Changes in the Python API" of the What's New in

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the review, Nick! (and also thanks to Martin for the great PEP!) -- ___ Python tracker ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8747e3455ecb by Berker Peksag in branch 'default': Issue #27366: Tweak PEP 487 documentation https://hg.python.org/cpython/rev/8747e3455ecb -- ___ Python tracker

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: Good catches Berker - go ahead and apply the improvements whenever's convenient :) -- ___ Python tracker ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Berker Peksag
Berker Peksag added the comment: Sorry, I'm a bit late to the party. Here are some tweaks to ecc7bff738e0. I've added versionadded directives, updated the tests to use new style classes and removed a duplicate sentence from the __init_subclass__ docstring. -- Added file:

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks once again Martin, especially for your patience with the long process in getting this proposal all the way through to resolution :) I mostly applied your patch as-is, but tweaked a few aspects of the documentation before committing it (mainly expanding

[issue27366] PEP487: Simpler customization of class creation

2016-07-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset ecc7bff738e0 by Nick Coghlan in branch 'default': Issue #27366: Implement PEP 487 https://hg.python.org/cpython/rev/ecc7bff738e0 -- nosy: +python-dev ___ Python tracker

[issue27366] PEP487: Simpler customization of class creation

2016-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Martin's latest patch looks good to me, so I'm applying it now and will push it once a local run of the test suite gives it the thumbs up :) -- ___ Python tracker

[issue27366] PEP487: Simpler customization of class creation

2016-07-25 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-25 Thread Martin Teichmann
Martin Teichmann added the comment: I looked over the patch once more and found some places where I didn't follow normal coding standards. I changed that, namely now the code returns -1 meaning an exception happened and 0 on success, which is what many functions in typeobject.c do. So I think

[issue27366] PEP487: Simpler customization of class creation

2016-07-24 Thread Guido van Rossum
Guido van Rossum added the comment: That's a no from me. On Sunday, July 24, 2016, Martin Teichmann wrote: > > Martin Teichmann added the comment: > > Thanks for the nice review! > > I made the proposed changes, see attached patch. > > I am still waiting for a decision

[issue27366] PEP487: Simpler customization of class creation

2016-07-24 Thread Martin Teichmann
Martin Teichmann added the comment: Thanks for the nice review! I made the proposed changes, see attached patch. I am still waiting for a decision whether type.__setattr__ should call __set_name__ from python-dev, once that's sorted out I'll implement and test the one or the other behavior.

[issue27366] PEP487: Simpler customization of class creation

2016-07-24 Thread Nick Coghlan
Nick Coghlan added the comment: Martin's current implementation basically looks good to me - I've mainly suggested some changes to the documentation and additional test cases that help stress test some of the more complex inheritance hierarchies described above, although there are a few other

[issue27366] PEP487: Simpler customization of class creation

2016-07-23 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: -> ncoghlan ___ Python tracker ___ ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-23 Thread Nick Coghlan
Nick Coghlan added the comment: Scratch that, my revised idea is fundamentally broken, as this example illustrates: >>> class BaseClass: pass ... >>> class OtherClass: pass ... >>> class SubClass(OtherClass, BaseClass): pass ... >>> SubClass.mro() [, , , ] The PEP as written handles this

[issue27366] PEP487: Simpler customization of class creation

2016-07-23 Thread Nick Coghlan
Nick Coghlan added the comment: I started reviewing Martin's patch, and I initially thought I had found a problem with the way __init_subclass__ is currently defined. It turned out I was wrong about it actually being broken, but I *do* now think it's inherently confusing, and we may be able

[issue27366] PEP487: Simpler customization of class creation

2016-07-23 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list

[issue27366] PEP487: Simpler customization of class creation

2016-07-22 Thread Martin Teichmann
Changes by Martin Teichmann : Added file: http://bugs.python.org/file43835/pep487.patch ___ Python tracker ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-22 Thread Martin Teichmann
Changes by Martin Teichmann : Removed file: http://bugs.python.org/file43834/pep487.patch ___ Python tracker ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-22 Thread Berker Peksag
Changes by Berker Peksag : -- components: +Interpreter Core -Library (Lib) nosy: +berker.peksag stage: -> patch review ___ Python tracker

[issue27366] PEP487: Simpler customization of class creation

2016-07-22 Thread Martin Teichmann
Changes by Martin Teichmann : Added file: http://bugs.python.org/file43834/pep487.patch ___ Python tracker ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-22 Thread Martin Teichmann
Changes by Martin Teichmann : Removed file: http://bugs.python.org/file43611/pep487a.patch ___ Python tracker ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-13 Thread Martin Teichmann
Changes by Martin Teichmann : Removed file: http://bugs.python.org/file43506/pep487.patch ___ Python tracker ___

[issue27366] PEP487: Simpler customization of class creation

2016-07-02 Thread Martin Teichmann
Martin Teichmann added the comment: This is a C implementation of PEP 487, directly in the Python core -- Added file: http://bugs.python.org/file43611/pep487a.patch ___ Python tracker

[issue27366] PEP487: Simpler customization of class creation

2016-06-22 Thread Martin Teichmann
New submission from Martin Teichmann: This is the implementation of PEP 487. It adds a metaclass to types that calls a method on a class once it is subclassed. This way one can customize the creation of classes without the need to write an own metaclass. As a second functionality, it calls a