Inheritance and inner classes in Python?

后端 未结 3 1349

In the following code class B has inherited yay attribute from class A, I expected this. I\'d also expect that inner class B.Foo

3条回答
  •  广开言路
    2021-02-04 04:10

    Foo is it's own class. It does not inherit from A. Because of this, it does not have any fields of A. The fact that is nested in a subclass of A does not change anything.

提交回复
热议问题