idiombench / Python /train /3.12 /annotated /modern_09.py
SwashBuckler001's picture
IdiomBench (part 4)
5501846 verified
Raw History Blame Contribute Delete
296 Bytes
@struct2.packed
class Student(NamedTuple):
name: Annotated[str, struct.ctype("<10s")]
get_type_hints(Student) == {'name': str}
get_type_hints(Student, include_extras=False) == {'name': str}
get_type_hints(Student, include_extras=True) == {
'name': Annotated[str, struct.ctype("<10s")]
}