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 stachel
Recipients stachel
Date 2018-03-19.03:30:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521430215.98.0.467229070634.issue33100@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-03-19 03:30:16stachelsetrecipients: + stachel
2018-03-19 03:30:15stachelsetmessageid: <1521430215.98.0.467229070634.issue33100@psf.upfronthosting.co.za>
2018-03-19 03:30:15stachellinkissue33100 messages
2018-03-19 03:30:15stachelcreate