summaryrefslogtreecommitdiff
path: root/astroid
diff options
context:
space:
mode:
authorMark Byrne <31762852+mbyrnepr2@users.noreply.github.com>2022-10-08 10:30:13 +0200
committerGitHub <noreply@github.com>2022-10-08 10:30:13 +0200
commit3d4dc50253a8cb0bf0ee8fda54c2bbea83bf9a92 (patch)
treed03bdf96fe2832c496f00efb47025f44e2ee6323 /astroid
parent1ffe4001633488c8c0cf1160d98793bbe3f79da9 (diff)
downloadastroid-git-3d4dc50253a8cb0bf0ee8fda54c2bbea83bf9a92.tar.gz
Add ``_value2member_map_`` member to the ``enum`` brain. (#1820)
Refs PyCQA/pylint#3941
Diffstat (limited to 'astroid')
-rw-r--r--astroid/brain/brain_namedtuple_enum.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/astroid/brain/brain_namedtuple_enum.py b/astroid/brain/brain_namedtuple_enum.py
index aa2ff3ce..dfc9bf68 100644
--- a/astroid/brain/brain_namedtuple_enum.py
+++ b/astroid/brain/brain_namedtuple_enum.py
@@ -425,6 +425,10 @@ def infer_enum_class(node: nodes.ClassDef) -> nodes.ClassDef:
new_targets.append(fake.instantiate_class())
dunder_members[local] = fake
node.locals[local] = new_targets
+
+ # The undocumented `_value2member_map_` member:
+ node.locals["_value2member_map_"] = [nodes.Dict(parent=node)]
+
members = nodes.Dict(parent=node)
members.postinit(
[