Open Optiligence opened 4 years ago
@Optiligence From what packages I imported, the error is working as intended. What package does this false positive occur for you? They may be improperly setting __path__
to a non-list data type.
Python 3.8.2 (default, Mar 4 2020, 00:07:26)
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylint
>>> pylint.__path__
['/home/user/Documents/pylint-issues/issue-3663/env/lib/python3.8/site-packages/pylint']
>>> type(pylint.__path__)
<class 'list'>
see the reproduction steps given above
in practice it’s a subpackage of another package, it has no __init__.py
My bad @Optiligence. I see now this applies to namespace packages
The relevant line of code occurs here: https://github.com/PyCQA/astroid/blob/master/astroid/interpreter/objectmodel.py#L147
astroid
should use the _NamespacePackage
class node instead of a list` class node when the module is a namespace package.
Steps to reproduce
Current behavior
Expected behavior
no error
pylint --version output