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 remi.lapeyre
Recipients eric.smith, remi.lapeyre, xtreak, Кирилл Чуркин
Date 2019-02-22.19:09:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550862598.63.0.923561441344.issue36077@roundup.psfhosted.org>
In-reply-to
Content
I think this is what is referring Кирилл Чуркин to:


Python 3.7.2 (default, Jan 13 2019, 12:50:01)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from dataclasses import dataclass
>>> @dataclass
... class Parent:
...     x: int = 1
...
>>> Parent()
Parent(x=1)
>>> @dataclass
... class Child(Parent):
...     y: int
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/dataclasses.py", line 991, in dataclass
    return wrap(_cls)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/dataclasses.py", line 983, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/dataclasses.py", line 904, in _process_class
    else 'self',
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/dataclasses.py", line 490, in _init_fn
    raise TypeError(f'non-default argument {f.name!r} '
TypeError: non-default argument 'y' follows default argument



@eric.smith, do you think Child's argument should be merged nicely with Parent's ones in this case? If so, can I propose a PR?
History
Date User Action Args
2019-02-22 19:09:58remi.lapeyresetrecipients: + remi.lapeyre, eric.smith, xtreak, Кирилл Чуркин
2019-02-22 19:09:58remi.lapeyresetmessageid: <1550862598.63.0.923561441344.issue36077@roundup.psfhosted.org>
2019-02-22 19:09:58remi.lapeyrelinkissue36077 messages
2019-02-22 19:09:58remi.lapeyrecreate