3 ms·
> The logic of type hint is not bad but sadly I think that type hint are making python source code messy and unreadable. Compared to legacy Python, yes. Compa
by wenc 2y ago
> The logic of type hint is not bad but sadly I think that type hint are making python source code messy and unreadable.
Compared to legacy Python, yes.
Compared to verbose language like Java, no. Python typing is equal or less verbose than Java (unless you use "var" in Java).
- ratmeadow 2y agoPython people legitimately upset they can't write every function like this now: def func(data, *kwargs): """data: the data. kwargs: other data."""
- FabHK 2y ago# returns the result
- nayuki 2y agoTechnically, Python typing is more verbose than Java because it uses more tokens. Compare these: Python: def foo(x: int, y: int) -> int: return x + y Java: int foo(int x, int y) { return x + y; } Python uses colons and arrows while Java uses positions to encode where the type should go.