3 ms·
`Any` is the correct call. It could be: def f(i=0) -> None: if i is None: do_something() else: do_something_else() Yeah, I know it's re
by rfoo 1y ago
`Any` is the correct call.
It could be:
def f(i=0) -> None:
if i is None:
do_something()
else:
do_something_else()
Yeah, I know it's retarded. I don't expect high quality code in a code base missing type annotation like that. Assuming `i` is `int` or `float` just makes incrementally adoption of a type checker harder.
- hk__2 1y agoNo it’s not. The typing system should use the most specific type available, and it’s your responsability to broaden it if needed. That’s how it works in all statically-typed languages.