-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
AstroidRelated to astroidRelated to astroidEnhancement ✨Improvement to a componentImprovement to a componentperformance
Description
Current problem
There is an Astroid function for detecting Numpy members (attribute_looks_like_numpy_member
). I'm sure it is very useful for code that uses Numpy, but for code that doesn't use Numpy it is a big waste of time. For example, running Pylint against Pylint itself, this function is called 1,441,536 times, and it is never true because Pylint doesn't use Numpy.
This makes a measurable time difference.
Desired solution
For a given Astroid brain, some effort should be made to detect whether that brain is actually needed. This might entail doing a pass over imports, or something like that. For a codebase that does not use Numpy, the Numpy brain should not be registered and none of its checks should be run, and similar for other brains.
Additional context
No response
Pierre-Sassoulas
Metadata
Metadata
Assignees
Labels
AstroidRelated to astroidRelated to astroidEnhancement ✨Improvement to a componentImprovement to a componentperformance