From: Nikita Sobolev Date: Sun, 27 Nov 2022 11:15:26 +0000 (+0300) Subject: gh-99677: Deduplicate self-type in `mro` in `inspect._getmembers` (#99678) X-Git-Tag: v3.12.0a3~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2653b82c1a44371ad0da6b5a1101abbda4acd2d3;p=thirdparty%2FPython%2Fcpython.git gh-99677: Deduplicate self-type in `mro` in `inspect._getmembers` (#99678) Closes #99677 --- diff --git a/Lib/inspect.py b/Lib/inspect.py index a896fcda31d1..31ac888126b5 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