class A(object):
class B(object): pass
class C(A.B): pass
results in
NameError: name 'A' is not defined
How do I inherit from B in C, if they are adjacent , both nested in A (inner classes)?
You cannot use A until the class body has finished executing.
You can refer to 'local' names; the class body is executed as a function, and the local namespace of that function is used to supply the class attributes; within the class body, B is a local name:
class A(object):
class B(object): pass
class C(B): pass