Define type alias
LabelType = str
OtherType = str
def f(x: OtherType):
print(x)
txt = "hello"
label: LabelType = txt
print(label)
f(txt)
f(label)
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
LabelType = str
OtherType = str
def f(x: OtherType):
print(x)
txt = "hello"
label: LabelType = txt
print(label)
f(txt)
f(label)