Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I still enjoy using Python but "runtime is funtime" even with type hinting and linting and everything else.

I'd love to see a s̶t̶r̶o̶n̶g̶ statically-typed Python that could throw type errors at compile time. I've only taken advantage of the duck typing once, and the way I did it was a massive code smell and I ended up refactoring it out anyways.



You mean statically typed? Python is already strongly typed.

Try running it through mypy with all the strict options. If you can get it to 100% pass and don't try to "cheat" the system too much with dynamic casts, I think you will find runtime type errors to be very rare.


> You mean statically typed? Python is already strongly typed.

Err...yes. I forget that "strong" and "static" are not the same and that "strong" and "duck" are not mutually exclusive.


Mypy gets you a lot of the way there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: