私はPythonが初めてで、オブジェクトのクラスが継承するクラスのリストを取得しようとしています。属性を使用してこれを実行しようとしていbases
ますが、成功していません。誰かが私を助けてくれますか?
def foo(C):
print(list(C.__bases__))
class Thing(object):
def f(self):
print("Yo")
class Shape(Thing):
def l(self):
print("ain't no thang")
class Circle(Shape):
def n(self):
print("ain't no shape")
test = Circle()
foo(test)