Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pycharm treats @validator decorated method as non-static method #195

Closed
no-life opened this issue Sep 21, 2020 · 8 comments
Closed

pycharm treats @validator decorated method as non-static method #195

no-life opened this issue Sep 21, 2020 · 8 comments
Labels

Comments

@no-life
Copy link

no-life commented Sep 21, 2020

image

The bar parameter shouldn't be treated this way.

PyCharm Pro 2020.2.2.
Pydantic plugin 0.1.13

@koxudaxi
Copy link
Owner

@no-life
The first argument always is a class object.
It means the method is class method.
https://pydantic-docs.helpmanual.io/usage/validators/

@no-life
Copy link
Author

no-life commented Sep 21, 2020

It's work with class method, but PyCharm still warning
image

@koxudaxi
Copy link
Owner

I can't representation the error. I use the same versions.
Screenshot_2020-09-22_16-20-57

@no-life
Copy link
Author

no-life commented Sep 22, 2020

Are you have enabled this inspection
image

@no-life
Copy link
Author

no-life commented Sep 22, 2020

I found.
I have this warning if I import from pydantic.class_validators import validator.
But have no warning in this case from pydantic import validator.

@koxudaxi
Copy link
Owner

I understand the problem.
I will fix it.
Thank you 😃

@koxudaxi
Copy link
Owner

@no-life
I have released a new version as 0.1.14
Screenshot_2020-09-23_02-56-46

@no-life
Copy link
Author

no-life commented Sep 22, 2020

Checked!

@no-life no-life closed this as completed Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants