From 2653b82c1a44371ad0da6b5a1101abbda4acd2d3 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sun, 27 Nov 2022 14:15:26 +0300 Subject: gh-99677: Deduplicate self-type in `mro` in `inspect._getmembers` (#99678) Closes #99677 --- Lib/inspect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/inspect.py b/Lib/inspect.py index a896fcd..31ac888 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -537,7 +537,7 @@ def _getmembers(object, predicate, getter): processed = set() names = dir(object) if isclass(object): - mro = (object,) + getmro(object) + mro = getmro(object) # add any DynamicClassAttributes to the list of names if object is a class; # this may result in duplicate entries if, for example, a virtual # attribute with the same name as a DynamicClassAttribute exists -- cgit v0.12