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
…5503)
Now we use a similar approach to
#14849
First, we generate a private name to store in a metadata (with `-`, so -
no conflicts, ever).
Next, we check override to be compatible: we take the currect signature
and compare it to the ideal one we have.
Simple and it works :)
Closes#15498Closes#9254
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ivan Levkivskyi <[email protected]>
Feature
Right now
mypy
does not support proper__post_init__
signatures.For example:
For now,
mypy
will allow a lot of incorrect code to slip in:def __post_init__(self, y: str) -> str: ...
, which needs to returnNone
def __post_init__(self, y: int) -> None: ...
, which has incorrect type fory
def __post_init__(self) -> None: ...
, which has noy
def __post_init__(self, x: int, y: str) -> None: ...
, which has extrax
paramPitch
We can easily support this feature and make sure that
__post_init__
signature is always correct for a dataclass.The text was updated successfully, but these errors were encountered: