Define type alias
examples/python-types-at-pyweb-2025-05/defined_type_alias.py
LabelType = str OtherType = str def f(x: OtherType): print(x) txt = "hello" label: LabelType = txt print(label) f(txt) f(label)
LabelType = str OtherType = str def f(x: OtherType): print(x) txt = "hello" label: LabelType = txt print(label) f(txt) f(label)