-
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
Property accessor hack for SQLAlchemy columns #444
Comments
Thanks for the bug report. Pyright wasn't properly handling overloads for the |
This is now fixed in version 1.1.12, which I just published. |
@erictraut This is very similar to the issue I'm facing (overloads on Either this issue has regressed, or there is a bug in the django stubs package. Honestly python generics and overloads are still relatively new to me and I struggle with deciphering them, so any help is appreciated. Update: Its seems like the issue is in django-stubs, I think they are keeping all field types generic without specifying a concrete type for the generic parameter. Here is Update 2: I figure it out, django-stubs has a custom mypy plugin that parses a |
I did find a bug in Pyright. it was not properly handling the You are correct that django-stubs relies on a mypy plugin for some of its behavior. Mypy plugins are very specific to mypy. They don't work with other type checkers like pyright. |
Yeah I'm almost certain that django-stubs was made in such a way that orm field type would only work on mypy, that But it's good that you found that bug, even if it wont solve my problem. |
Describe the bug
The SQLAlchemy stubs from Dropbox use descriptors for
Column
attributes returning the underlying type (in this case, a string) for objects of the enclosing class [2]:This is not being picked up by pyright. Compare with mypy:
To Reproduce
Add the SQLAlchemy stubs in
typingsPath
and type check the snippet below.Expected behavior
Foo().bar
should be of typestr
.Screenshots or Code
VS Code extension or command-line
extension, 1.1.11
The text was updated successfully, but these errors were encountered: