This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Brian Petersen
Recipients Brian Petersen
Date 2017-03-27.20:15:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490645716.61.0.370506837908.issue29923@psf.upfronthosting.co.za>
In-reply-to
Content
First time issue reporter here.  I really love PEP 487, but I'm finding the new __init_subclass__ functionality is not playing nicely with existing abstract class functionality.

For example, taking the Quest example given in PEP 487 but simply adding ABCMeta metaclass results in a runtime error:

```
class QuestBase(metaclass=abc.ABCMeta):
    # this is implicitly a @classmethod (see below for motivation)
    def __init_subclass__(cls, swallow, **kwargs):
        cls.swallow = swallow
        super().__init_subclass__(**kwargs)

class Quest(QuestBase, swallow="african"):
   pass

print(Quest.swallow)


Traceback (most recent call last):
  File "credentials.py", line 23, in <module>
    class Quest(QuestBase, swallow="african"):
TypeError: __new__() got an unexpected keyword argument 'swallow'
```
History
Date User Action Args
2017-03-27 20:15:16Brian Petersensetrecipients: + Brian Petersen
2017-03-27 20:15:16Brian Petersensetmessageid: <1490645716.61.0.370506837908.issue29923@psf.upfronthosting.co.za>
2017-03-27 20:15:16Brian Petersenlinkissue29923 messages
2017-03-27 20:15:16Brian Petersencreate