| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
One reason I'm surprised about this is that my impression was that after a module-level assert that is unreachable, mypy removes all nodes. Am I misremembering? Or is this an earlier pass? |
Sorry, something went wrong.
|
@A5rocks Great question. Imports are collected during parsing, and "definitely unreachable" truncation step follows (SemanticAnalyzerPreAnalysis). It does not modify MypyFile.imports collected at the previous step, so we still treat such modules as dependencies even if the corresponding import statement no longer exists, and "missing module" errors are produced by build manager when any dependency can't be resolved. Those imports aren't marked unreachable either. That probably should be fixed instead, thanks! That will be a better approach. |
Sorry, something went wrong.
There was a problem hiding this comment.
This makes sense to me!
Sorry, something went wrong.
Sorry, something went wrong.
|
@petamasS3D just wait - I usually follow up on my PRs monthly if they lack attention. Things just aren't quickly merged here except for trivial fixes/emergencies, and this one certainly isn't a trivial fix (and is a bit hacky), so it's normal to wait a while and gather feedback from other maintainers. If this issue is blocking you, you can safely add an ignore comment - typechecker false positive is one of perfectly legitimate reasons to use them. |
Sorry, something went wrong.
|
@sterliakov: thanks for the insight! I saw that there are a LOT of newer PRs already merged, and was afraid this one somehow got lost. It's not blocking me at the moment (I've worked around the issue using an if around the imports, and asserting afterwards), just hoped for a quick resolution after you immediately jumped on my bug report. (Thank you for that!) I'll wait patiently until the process completes. :) |
Sorry, something went wrong.
|
Diff from mypy_primer, showing the effect of this PR on open source code: PyWinCtl (https://github.com/Kalmat/PyWinCtl)
- src/pywinctl/_pywinctl_win.py:28: error: Cannot find implementation or library stub for module named "pywinbox" [import-not-found]
- src/pywinctl/_pywinctl_macos.py:25: error: Cannot find implementation or library stub for module named "pywinbox" [import-not-found]
|
Sorry, something went wrong.
|
@JukkaL can we try to get this into the next release? The change is trivial and there's no sane workaround for the problem |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #19346