Y
Hacker News
new
|
ask
|
show
|
jobs
by
qwefsdf
1294 days ago
With type hints you would model this as a Union type, i.e., Union[int, str]. This is perfectly legal with mypy and other Python type checkers.