mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +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.
23 lines
342 B
Python
23 lines
342 B
Python
class X(<error descr="Unresolved reference 'Unresolved'">Unresolved</error>):
|
|
pass
|
|
|
|
|
|
class Y(<error descr="Unresolved reference 'Unresolved'">Unresolved</error>):
|
|
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) # pass
|