Hacker News new | ask | show | jobs
by strogonoff 2293 days ago
A good way of specifying variable types in sample code is with Python’s native type hint syntax[0].

Using angle brackets is an option, but it results in invalid syntax (confusing to beginner programmers) and is used by languages such as TypeScript and Swift to signify generics (confusing to established engineers coming from those languages).

[0] https://docs.python.org/3/library/typing.html