Re:Parse, Don't Validate (2019)
by nooorofe on Saturday June 26, 2021 @07:54PM
(#27647141)
There is one thing concerns me about type annotation. With annotation Python code looks like Java code, but with it I don't have advantages of Java (like speed). Besides I see things like `x: typing.Union[str, typing.Any]` - maybe better no annotation.
[ Parent
| on HN ]
> x: typing.Union[str, typing.Any]
That's absolutely a valid and useful annotation. It tells me, and autocomplete, that "x" is probably a str, more likely than not, but I need to be aware that it might not be.