3 ms·
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 invali
by strogonoff 7y 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 https://docs.python.org/3/library/typing.html