-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Unhelpful error "Invalid base class mypy(error)" #6372
Comments
In this case it is because the Base class is dynamic (computed from a function return), therefore mypy cannot use it for static analysis. Also this is a duplicate of #2477 (the issue is tracking a better error message and add support for dynamic base classes #2477 (comment)). |
@vivaldus As I mentioned in my closing notice for #2477 you should use SQLAlchemy plugin. The error message is now tracked in #4030. |
Mypy does not support a base class that is returned from a function. See https://github.com/python/mypy/wiki/Unsupported-Python-Features for details Similar reported cases: python/mypy#4284 python/mypy#6372
Mypy does not support a base class that is returned from a function. See https://github.com/python/mypy/wiki/Unsupported-Python-Features for details Similar reported cases: python/mypy#4284 python/mypy#6372
The following sql-entity class was generated by sqlalchemy -- so this is the standard way to create such a class and operate it. However,
mypy
calls Base here anInvalid base class
. But why? No further details are given, I see no such error described in mypy documentation, and googling "Invalid base class" doesn't lead me to any obvious results. I have no way to diagnose the problem.mypy version 0.660
python version 3.7.2
The text was updated successfully, but these errors were encountered: