-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SQL Alchemy and pyright #626
Comments
The problem here is that SQL Alchemy is making use of a metaclass (DeclarativeMeta) that implements non-standard behaviors. In particular, it dynamically auto-generates a constructor based on the class variables you've defined. PyCharm apparently has knowledge of this custom behavior. Pyright does not currently have knowledge of non-standard behaviors within any third-party libraries, and I don't currently plan to add such knowledge. I may eventually add a plug-in mechanism to pyright so non-standard behaviors for third-party libraries could be expressed in plug-in logic. This is how mypy solves this problem. I'm not able to repro the exact errors that you're seeing. I might be able to offer some suggested workarounds, but I'll need some additional information from you first.
|
Just to report that changing
Edit: worked by stopping recognizing my own libraries too, I guess the real solution is |
I have a class which has a superclass, and uses sqlalchemy definitions of instance variables
eg:
when I try to create an instance of
Model
passing in properties the syntax highlighting blows upIs this because it's looking in the superclass for these properties?
or the syntax above for SQLAlchemy columns confuses things?
VS Code extension or command-line
Using within VSCode
Additional context
Above works fine in PyCharm
The text was updated successfully, but these errors were encountered: