1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00
semantic/test/fixtures/python/analysis/multiple_inheritance.py
Patrick Thomson 178da2959e Implement multiple inheritance.
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.
2018-03-22 15:54:21 -04:00

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()