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
The above code snippet is behaving as expected for cases with D1 and D3.
For D1, The init var for a stdlib dataclass field specifies whether or not the given field is included as a parameter to the generated __init__ method. See the docs here.
For D3, the init_var specification is used to note that the field is an init-only field. See these docs for more details.
That being said, I do think there's an issue with case 2. I think we could implement a fix similar to that from this PR: #7827.
Initial Checks
Description
Passing a parameter marked as
init=False
(orinit_var=False
) does not raise an exceptionExample Code
Output:
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: