Message405920
I think a good possible solution is to raise an error if `default_factory` is provided on a `init=False` dataclass that doesn't have a `__init__()` defined. However, it will create a slight inconsistency because there will be an error when `__init__` is not defined, but no error otherwise -- to allow calling the factory in custom defined `__init__()`.
The error would be "Error: default_factory argument needs `init=True` to be set on dataclass because default_factory value is created in the generated __init__() method". |
|
Date |
User |
Action |
Args |
2021-11-08 01:28:02 | andrei.avk | set | recipients:
+ andrei.avk, eric.smith, sobolevn, simple_coder878 |
2021-11-08 01:28:02 | andrei.avk | set | messageid: <1636334882.59.0.183965423507.issue45366@roundup.psfhosted.org> |
2021-11-08 01:28:02 | andrei.avk | link | issue45366 messages |
2021-11-08 01:28:02 | andrei.avk | create | |
|