diff -r c368e43859ba Lib/inspect.py --- a/Lib/inspect.py Sat Aug 24 00:42:54 2013 +0300 +++ b/Lib/inspect.py Sun Aug 25 17:41:08 2013 +0300 @@ -789,7 +789,8 @@ for parent in c.__bases__: if not parent in children: children[parent] = [] - children[parent].append(c) + if c not in children[parent]: + children[parent].append(c) if unique and parent in classes: break elif c not in roots: roots.append(c) diff -r c368e43859ba Lib/test/inspect_fodder.py --- a/Lib/test/inspect_fodder.py Sat Aug 24 00:42:54 2013 +0300 +++ b/Lib/test/inspect_fodder.py Sun Aug 25 17:41:08 2013 +0300 @@ -49,6 +49,8 @@ class MalodorousPervert(StupidGit): pass +Tit = MalodorousPervert + class ParrotDroppings: pass diff -r c368e43859ba Lib/test/test_inspect.py --- a/Lib/test/test_inspect.py Sat Aug 24 00:42:54 2013 +0300 +++ b/Lib/test/test_inspect.py Sun Aug 25 17:41:08 2013 +0300 @@ -225,7 +225,9 @@ [('FesteringGob', mod.FesteringGob), ('MalodorousPervert', mod.MalodorousPervert), ('ParrotDroppings', mod.ParrotDroppings), - ('StupidGit', mod.StupidGit)]) + ('StupidGit', mod.StupidGit), + ('Tit', mod.MalodorousPervert), + ]) tree = inspect.getclasstree([cls[1] for cls in classes], 1) self.assertEqual(tree, [(object, ()),