You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(x: float = 15, z: int = 10, t: int = 0, *, y: int = 0, w: int = 1) -> None
The text was updated successfully, but these errors were encountered:
OrHayat
changed the title
is there any way to specify KW_ONLY location in the constructor like in dataclass.KW_ONLY
Way to specify KW_ONLY location in the constructor like in dataclass.KW_ONLY
Feb 20, 2024
dataclass in python 3.10 and above got KW_ONLY sentinel value
it allows you to mark where the constructor will start the KWARGS in the class
https://docs.python.org/3/library/dataclasses.html#dataclasses.KW_ONLY
i did not found a way to do this in attrs package
the function signature of the init will be
the dataclass one will re order the items order in the constructor and handle inheritance properly(if needed)
https://docs.python.org/3/library/dataclasses.html#re-ordering-of-keyword-only-parameters-in-init
function signature:
The text was updated successfully, but these errors were encountered: