-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
__init__ arguments in base class are handled incorrectly. #135
Comments
Are you using a type stub file for itsdangerous? If so, could you post that here? I don't see a type stub file (e.g. itsdangeours.pyi or init.pyi) in the itsdangerous repo, so perhaps you've created a custom one? If you're not using a type stub file, pyright will not know anything about the imported symbol — its type will be "Unknown", and it should not generate any errors for its usage. I just confirmed this by using the following code:
|
I'm using |
Thanks for the bug report. This is indeed a bug, and it will be fixed in the next version. If you're interested, it occurs only in cases where a class derives from multiple subclasses and there is no |
This is now fixed in version 1.0.33, which I just published. Thanks again for the bug report. |
Great! Thank you. |
Pyright supports a "typingsPath" setting. It's intended to point to a local directory within your code base that includes custom type stubs that you write and maintain for imported libraries that do not provide their own. That's what I use for my team's source base. I created a top-level subdirectory called "typestubs". Beneath that are directories with the names of each imported module, and I've created typestub files in each of those folders. Does that address your needs? |
Describe the bug
Does not handle correctly
__init__()
parameters that are defined in a base class for one of inherited mixed-in classes.To Reproduce
Got pyright error message:
Expected no arguments to 'URLSafeTimedSerializer' constructor
But one of the base classes to URLSafeTimedSerializer has eventually a base class where
__init__()
has parameters.Expected behavior
Should not see an error.
Screenshots or Code
See above.
VS Code extension or command-line
VSCode pyright 1.0.32
Additional context
https://github.com/pallets/itsdangerous
The text was updated successfully, but these errors were encountered: