DEV Community

Discussion on: A Failed Experiment with Python Type Annotations

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Thank you.

I'm going to give it another go soon. The issue about self-referential types is essentially fixed in an upcoming Python release, and I can import from future now.

The return types are still annoying, but the reveal types will help. I got another comment that mypy may add an option to allow inferred return types.

At the moment, doing a refactoring, I'm leaning towards typing all the return types is the lesser of evils -- when compared to hunting down type mismatches.