Hacker News new | past | comments | ask | show | jobs | submit login

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: