I like to where this is going. Plus one from me. I assume the main users of this annotated metadata will be typing checker(s) plugins? Do we provide any unrolling guarantees with type aliases?
UnsignedShort = Annotated[int, struct2.ctype('H')]
class Student(struct2.Packed):
name: UnsignedShort
Do we get?
get_type_hints(Student, include_extras=True) == { 'name': UnsignedShort}
or
get_type_hints(Student, include_extras=True) == { 'name': Annotated[int, struct2.ctype('H')]}
I would propose to make it explicit what's the expected behaviour here (so processing code does not need to handle both cases). I'd guess the easiest and safest is to go with the { 'name': UnsignedShort} form always.