Message336343
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? |
|
Date |
User |
Action |
Args |
2019-02-22 19:09:58 | remi.lapeyre | set | recipients:
+ remi.lapeyre, eric.smith, xtreak, Кирилл Чуркин |
2019-02-22 19:09:58 | remi.lapeyre | set | messageid: <1550862598.63.0.923561441344.issue36077@roundup.psfhosted.org> |
2019-02-22 19:09:58 | remi.lapeyre | link | issue36077 messages |
2019-02-22 19:09:58 | remi.lapeyre | create | |
|