Message314077
I've tried to declare two classes
@dataclass
class Base:
__slots__ = ('x',)
x: Any
@dataclass
class Derived(Base):
x: int
y: int
As long as I correctly understood PEP 557 (inheritance part), changing type of variable is possible. This code produce error:
TypeError: non-default argument 'y' follows default argument
'x' variable in Derived class has changed default from MISSING to member_descriptor and that's the reason of the exception. |
|
Date |
User |
Action |
Args |
2018-03-19 03:30:16 | stachel | set | recipients:
+ stachel |
2018-03-19 03:30:15 | stachel | set | messageid: <1521430215.98.0.467229070634.issue33100@psf.upfronthosting.co.za> |
2018-03-19 03:30:15 | stachel | link | issue33100 messages |
2018-03-19 03:30:15 | stachel | create | |
|