-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed as not planned
Labels
type-inferenceRequires more advanced type inference.Requires more advanced type inference.
Description
I'm interested in implementing no-name-in-module (E0611) and import-error (E0401) for pylint (#970).
I think this would handle this issue #6327 but as mentioned in that issue thread it might get a little complex with things like virtual environments.
I've taken a brief look at the resolver but wondering if there has been any other work into this issue before continuing. A couple of my thoughts:
- I believe pylint essentially runs the code and catches the exceptions
ImportErrorandModuleNotFoundError, although it will return all errors, not just the first, with a line likeimport os.foobartriggering both errors - ruff appears to be so fast currently due to avoiding (or at least minimizing) invoking any python
- is there any way to achieve this functionality without actually calling python, such as somehow determining a list of available modules (for
import-errorat least)? Could this ever be fully trustworthy? I'm guessing not. - if python does have to be called (can't really see a way to avoid it for
no-name-in-module, especially when it comes to things like c libraries), are there ways to optimize/minimize python usage/runtime?
s-m-e, a1d4r, walsha2, fsbraun, mcocdawc and 1 more
Metadata
Metadata
Assignees
Labels
type-inferenceRequires more advanced type inference.Requires more advanced type inference.