New semantic analyzer: Namespace package with __init__.py breaks analysis
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
I'm getting a lot of errors reported that are not errors.
- Classes are reported as invalid types
- Calls to methods are reported as modules not having those attributes
- Instances of classes are reported as modules not callable
- Types passed to, e.g.,
isinstanceare reported asincompatible type Module(suggests that all custom types are treated as type Module) - Base classes are reported as invalid base classes
- Calls to instances of classes are reported as not having the specified attributes
- Package imports in
__init__.pyare reported as already defined
I am not sure whether these are issues are caused by the new semantic analyzer or by the Mypy plugin for PyCharm which has not been updated yet.
In comparison, with the new semantic analyzer disabled, there are no errors. The application works correctly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by reproducing the reported false positives with a namespace package containing init.py, comparing the new semantic analyzer with it disabled and considering the PyCharm plugin distinction. Done means the listed class, method, instance, inheritance, and package-import errors are no longer reported for the reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100