|
|
|
|
|
by ameminator
1627 days ago
|
|
I'm going to hard disagree with you here. Type hints are a key tool in working on a large Python project in a large team. Tests are, of course, necessary. But type hints allow Python (and all its benefits) to be used in industrial environments where it otherwise would be intractable. |
|
E.g., when I write numerical python code I'll often just use a string like `"(n_items, n_dims)"` as the type hint, or if the only salient detail of a signature is that some dimensions match I might even write something as simple as `foo(bar: "(a, b)", baz: "(b, c)")`. Ofttimes that's the only data a developer really cares about in that programming context, so a more complete type hint (one designed for mypy and the rest of the tooling) would just take longer to read and understand.