Enum
: Mismatch between __members__
and the members infered by astroid
#1730
Labels
Enum
: Mismatch between __members__
and the members infered by astroid
#1730
Steps to reproduce
Here is an MWE that show the mismatch:
Current behavior
astroid version 2.12.2
python version 3.10.2
Output of above MWE:
Expected behavior
Wrongly reported members should be empty.
The only thing that I'm not entirely sure about is the
__PRIVATE_MEMBER
. In Py 3.10 I get aI don't fully understand how private names will be treated in 3.11 (here and here), but in any case
astroid
should conform with the python behavior IMO.python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
output2.12.2
Context
This issue is the result of the discussion at pylint-dev/pylint#7257. I managed to track down the enum-logic to https://github.com/PyCQA/astroid/blob/3621e2e7d68653d66cbf770e6dcb61ba541117f1/astroid/brain/brain_namedtuple_enum.py#L358-L460 but unfortunately I currently don't have the resources to dive into this & try to find out how to improve the logic.
The text was updated successfully, but these errors were encountered: