idiombench / Python /train /3.10 /annotated /modern_09.py
SwashBuckler001's picture
IdiomBench
16ef63d 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")]
}