mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
If the C3 MRO algorithm fails and the old-style ancestors algorithm tells that there are unresolved ancestors, we return a single 'null' ancestor as a sign that we don't know who the ancestors really are. If there are no unresolved ancestors, then we fall back to the old-style ancestors algorithm in order to make resolve work. A future inspection for detecting incorrect MRO may warn the user about this situation.
24 lines
234 B
Python
24 lines
234 B
Python
class X(Unresolved):
|
|
pass
|
|
|
|
|
|
class Y(Unresolved):
|
|
pass
|
|
|
|
|
|
class A(X, Y):
|
|
def foo(self):
|
|
pass
|
|
|
|
|
|
class B(Y, X):
|
|
pass
|
|
|
|
|
|
class C(A, B): # we don't know whether MRO is OK or not
|
|
pass
|
|
|
|
|
|
print(C.foo)
|
|
# <ref>
|