Message290641
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'
``` |
|
Date |
User |
Action |
Args |
2017-03-27 20:15:16 | Brian Petersen | set | recipients:
+ Brian Petersen |
2017-03-27 20:15:16 | Brian Petersen | set | messageid: <1490645716.61.0.370506837908.issue29923@psf.upfronthosting.co.za> |
2017-03-27 20:15:16 | Brian Petersen | link | issue29923 messages |
2017-03-27 20:15:16 | Brian Petersen | create | |
|