The problem is that _set_remaining_attrs uses __annotations__ to set any attributes that are not present in the constructor.
This works fine for classes that just inherit from object or for attributes declared directly on a subclass. However, it doesn't retrieve annotations from any parent class.
The problem is compounded because the failure is completely silent.
Instead get_type_hints should be used which will return hints from parents also.
The problem is that
_set_remaining_attrs
uses__annotations__
to set any attributes that are not present in the constructor.This works fine for classes that just inherit from
object
or for attributes declared directly on a subclass. However, it doesn't retrieve annotations from any parent class.The problem is compounded because the failure is completely silent.
Instead
get_type_hints
should be used which will return hints from parents also.