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
Inheritance is a per-class thing. In your code class B
inherits from class A
, but just because both of them have inner class Foo
doesn't tell us anything about their inheritance.
If you want B.Foo
to have the attributes from A.Foo
, you need to make B.Foo
inherit from A.Foo
:
class B(A):
class Foo(A.Foo):
bob = False