Originating from this post, I observed the following behavior:
class A[T]:
a: T
class B[T, P](A[T]):
b: P
from typing import get_type_hints
# Gets all annotated attributes on B's inheritance chain
get_type_hints(B) # {'a': T, 'b': P}
# Approaches below only get B's own attributes
get_type_hints(B()) # {'b': P}
B.__annotations__ # {'b': P}
B().__annotations__ # {'b': P}
Is this a bug or a feature? If it is a feature, is there any existing discussion on the rationale of this behavior?