Skip to content

Commit 8763111

Browse files
Handle objects.Super in helpers.object_type() (#2177)
(cherry picked from commit b186f68)
1 parent 420a59a commit 8763111

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ What's New in astroid 2.15.5?
1212
=============================
1313
Release date: TBA
1414

15+
* Handle ``objects.Super`` in ``helpers.object_type()``.
16+
17+
Refs pylint-dev/pylint#8554
1518

1619

1720
What's New in astroid 2.15.4?

astroid/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from collections.abc import Generator
1010

11-
from astroid import bases, manager, nodes, raw_building, util
11+
from astroid import bases, manager, nodes, objects, raw_building, util
1212
from astroid.context import CallContext, InferenceContext
1313
from astroid.exceptions import (
1414
AstroidTypeError,
@@ -65,7 +65,7 @@ def _object_type(
6565
raise InferenceError
6666
elif isinstance(inferred, util.UninferableBase):
6767
yield inferred
68-
elif isinstance(inferred, (bases.Proxy, nodes.Slice)):
68+
elif isinstance(inferred, (bases.Proxy, nodes.Slice, objects.Super)):
6969
yield inferred._proxied
7070
else: # pragma: no cover
7171
raise AssertionError(f"We don't handle {type(inferred)} currently")

tests/test_helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def test_object_type(self) -> None:
4242
("type", self._extract("type")),
4343
("object", self._extract("type")),
4444
("object()", self._extract("object")),
45+
("super()", self._extract("super")),
4546
("lambda: None", self._build_custom_builtin("function")),
4647
("len", self._build_custom_builtin("builtin_function_or_method")),
4748
("None", self._build_custom_builtin("NoneType")),

0 commit comments

Comments
 (0)