[issue39300] dataclasses non-default argument follows default argument

2020-01-11 Thread Eric V. Smith
Eric V. Smith added the comment: > Ah, I see, so if I understand correctly the init method for the example given > would become __init__(self, PARAM: int = 1, ARG: int) since the fields are > kept in an ordered mapping Correct. -- assignee: -> eric.smith resolution: -> not a bug s

[issue39300] dataclasses non-default argument follows default argument

2020-01-10 Thread lijok
lijok added the comment: > I think this is a combination of the above statement at end of [0] and > inheritance following the order of the fields at [1] Ah, I see, so if I understand correctly the init method for the example given would become __init__(self, PARAM: int = 1, ARG: int) since t

[issue39300] dataclasses non-default argument follows default argument

2020-01-10 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: See also issue36077 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue39300] dataclasses non-default argument follows default argument

2020-01-10 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > TypeError will be raised if a field without a default value follows a field > with a default value. This is true either when this occurs in a single class, > or as a result of class inheritance. I think this is a combination of the above statemen

[issue39300] dataclasses non-default argument follows default argument

2020-01-10 Thread lijok
New submission from lijok : from dataclasses import dataclass @dataclass class A: PARAM: int @dataclass class B(A): ARG: int PARAM: int = 1 Traceback (most recent call last): File "", line 2, in File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\dataclasses.py"