astroid icon indicating copy to clipboard operation
astroid copied to clipboard

Infer members of ``Enums`` as instances of the ``Enum`` they belong to

Open DanielNoord opened this issue 3 years ago • 3 comments

Steps

  • [x] For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • [x] Write a good description on what the PR does.

Description

Closes #744

Also partially refs https://github.com/PyCQA/astroid/issues/142.

We need some way to store attributes that are specific to an individual instance. I'm not sure if this is the best way so I'm open to feedback!

Type of Changes

Type
:bug: Bug fix
:sparkles: New feature

DanielNoord avatar Jun 06 '22 11:06 DanielNoord

Pull Request Test Coverage Report for Build 2624305299

  • 38 of 38 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 92.124%

Totals Coverage Status
Change from base Build 2624303150: -0.005%
Covered Lines: 9439
Relevant Lines: 10246

💛 - Coveralls

coveralls avatar Jun 06 '22 12:06 coveralls

Marking as draft as there seem to be changes to this in 3.12 and possibly in 3.11: https://github.com/python/cpython/issues/93910

Perhaps we should retain old behaviour.

DanielNoord avatar Jun 24 '22 13:06 DanielNoord

A decision was made to revert the change in: https://github.com/python/cpython/issues/93910

So, this is still valid for 3.11.

It's blocked by https://github.com/PyCQA/astroid/pull/1689 which is a bug fix that is necessary for the change here but I think this can already be reviewed.

DanielNoord avatar Jul 06 '22 15:07 DanielNoord