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
Describe the bug
After upgrading from 1.1.343 to 1.1.344 I can no longer find a way to annotate my pydantic validators that pyright will accept.
I was able to replicate the problem with the below reduced code sample.
(Note: I also had to rename my value parameter to __value to match the Protocol, but that seems like an unnecessary requirement since these are position-only parameters)
/path/to/pyright_bug.py
/path/to/pyright_bug.py:19:6 - error: Argument of type "(cls: type[Self@FakeModel], __value: Any, /) -> Any" cannot be assigned to parameter of type "ModelBeforeValidatorWithoutInfo"
Type "(cls: type[Self@FakeModel], __value: Any, /) -> Any" cannot be assigned to type "(cls: Any, __value: Any) -> Any"
Position-only parameter mismatch; parameter "cls" is not position-only
Position-only parameter mismatch; parameter "__value" is not position-only
Position-only parameter mismatch; expected 2 but received 0 (reportGeneralTypeIssues)
/path/to/pyright_bug.py:24:6 - error: Argument of type "(cls: type[Self@FakeModel], __value: Any, /) -> Any" cannot be assigned to parameter of type "ModelBeforeValidatorWithoutInfo"
Type "(cls: type[Self@FakeModel], __value: Any, /) -> Any" cannot be assigned to type "(cls: Any, __value: Any) -> Any"
Position-only parameter mismatch; parameter "cls" is not position-only
Position-only parameter mismatch; parameter "__value" is not position-only
Position-only parameter mismatch; expected 2 but received 0 (reportGeneralTypeIssues)
2 errors, 0 warnings, 0 informations
If your code relies on symbols that are imported from a third-party library, include the associated import statements and specify which versions of those libraries you have installed.
VS Code extension or command-line
Are you running pyright as a VS Code extension, a language server in another editor, integrated into Pylance, or the command-line tool? Which version?
Running the command-line using the python wrapper:
> pyright --version
pyright 1.1.344
The text was updated successfully, but these errors were encountered:
This is a duplicate of #6875. Looks like both bugs were filed within a couple of minutes of each other :). I'm going to close this one in favor of the other one.
Describe the bug
After upgrading from 1.1.343 to 1.1.344 I can no longer find a way to annotate my pydantic validators that pyright will accept.
I was able to replicate the problem with the below reduced code sample.
(Note: I also had to rename my value parameter to
__value
to match the Protocol, but that seems like an unnecessary requirement since these are position-only parameters)Code or Screenshots
Output:
If your code relies on symbols that are imported from a third-party library, include the associated import statements and specify which versions of those libraries you have installed.
VS Code extension or command-line
Are you running pyright as a VS Code extension, a language server in another editor, integrated into Pylance, or the command-line tool? Which version?
Running the command-line using the python wrapper:
> pyright --version pyright 1.1.344
The text was updated successfully, but these errors were encountered: