@ado

My fear is that this type hinting pushes #python down the same bad road as #cpp:

Making an originally nice programming language more and more complex and ugly by giving in to the pressure of adding more and more features which don't fit into the original idea of the programming language.

In my view, the core philosophy of #python is that it is a high-level dynamically typed language . And the core philosophy of #cpp is that it is a low-level statically typed language.

Don't mix that.

@folkerschamel @ado

But you don't have to use type hints at all, even in the latest versions. They're completely optional. You could write an entire new application without a single type hint in it, and it would work just fine. Static linters like mypy wouldn't be able to find as many problems without the hints, but that's a tradeoff.

Or does it somehow bother you when some #dependency has type hints in its code?

@cazabon @folkerschamel @ado While I am a very happy user of type annotations and mypy, when a large popular project adopts them it creates another barrier to contributions. It is not a zero-cost change.

@kevin @folkerschamel @ado

Fair point; the code becomes more visually complex. For a beginner, that probably makes a difference.

On the other hand, using type hints saves so much developer time, since bugs are easier to catch, especially with static type checking tools. So adding hints to a project's codebase makes the existing developers more productive.

I suspect that any new dev wanting to contribute to a project will be past the point where hints hurt their participation.

@cazabon @kevin @folkerschamel @ado we're writing an integration for a complex #python behemoth that is spread over many dozens of repos, packages and layers of abstraction. The documentation is insufficient. If they at least had type hints, I would have a much easier time untangling how everything is connected.

Things should be as simple as possible, but not simpler. I hate code where I have to do detective work to see what kind of object I get. I think you're wrong about types.

@zenforyen @cazabon @kevin @ado

#python type hints as "better than no documentation at all!"

Interesting take, didn't think about that.🙂

@folkerschamel @cazabon @kevin @ado that's just to give you a very non-theoretical example.

If you do it right, types are succinct, machine-checkable documentation and safety rail. Because they are optional in python, I can escape them to do dynamic magic that mypy has no chance to follow. It does not have to be perfect to be immensely useful.

And you can avoid creating+maintaining trivial sanity-check tests or isinstance guards in code for things mypy can see and warn about.