3 ms·
dataclasses author here. Does the keyword-only feature in 3.10 help you at all?
by ericvsmith 5y ago
dataclasses author here.
Does the keyword-only feature in 3.10 help you at all?
- abdusco 5y agoWow, I was unaware of this feature. It appears there are 3 ways to declare fields as keyword-only. @dataclass(kw_only=True) class Birthday: name: str birthday: datetime.date # --- @dataclass class Birthday: name: str birthday: datetime.date = field(kw_only=True) # --- from dataclasses import KW_ONLY @dataclass class Point: x: float y: float _: KW_ONLY z: float = 0.0 t: float = 0.0 https://docs.python.org/3/whatsnew/3.10.html#keyword-only-fields https://docs.python.org/3/whatsnew/3.10.html#keyword-only-fi...
- muxator 5y agoAnd a big thank you for the dataclasses module, and for making the life of the whole python community a little easier!
- nurettin 5y agoLove it, thank you!