mirror of
https://github.com/github/semantic.git
synced 2024-11-29 11:02:26 +03:00
178da2959e
Python is the only language that we support that permits multiple inheritance, which is probably good, since MI is generally considered a sign of a poorly-designed object hierarchy. But there's no reason not to support it. This algorithm is more simplistic than Python's actual method-resolution lookup, but it's fine for now, and the behavior for simple cases matches that of Python.
13 lines
147 B
Python
13 lines
147 B
Python
class Foo:
|
|
def dang(self):
|
|
return "foo!"
|
|
|
|
class Bar:
|
|
def dang(self):
|
|
return "bar!"
|
|
|
|
|
|
class Baz(Foo, Bar): pass
|
|
|
|
Baz.dang()
|