-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
mypy generates false positive with custom constants defined via the signal
module
#8745
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
Comments
If you are running a non-standard Python build, you will have to do this. I'm not sure what other way you'd want mypy to detect this. Mypy does static analysis, it isn't going to import the C extension. |
sigh. The architecture with mypy & typeshed is broken. I can't believe I'm the first person that's had to fork I can understand if the stance is that python/typeshed#3953 needs to be fixed first, but the |
You could shadow |
You can perhaps use |
Summary
Description
My group added a custom signal to our copy of the signal C extension under python 3.
Unfortunately, mypy 0.770 with
--strict
set fails to recognize the constant defined as part of thesignal
module, as seen below with a redacted sample:Repro steps:
signal.py
:mypy_doesnt_like_sigcustom.py
:mypy --strict mypy_doesnt_like_sigcustom.py
Expected result
mypy
shouldn't fail to resolvesignal.SIGCUSTOM
.Actual result
mypy
fails similar to the following:The text was updated successfully, but these errors were encountered: