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

If Python were statically typed:

- Most Python expressions and standard library functions would have (nontrivial) types

- It would be unusual for a Python library to come without (nontrivial) types

- It would be unusual for Python code containing type errors to be distributed

- Many classes of runtime errors (e.g. no such method) would be unusual in Python code that does not contain type errors



Python is not statically typed. Mypy adds a layer of static typing on top of Python.


Right, but it's misleading to say "Python has static typing", because while an implementation of static typing in Python exists, the vast majority of the Python ecosystem doesn't use it.


That's why I didn't say 'Python has static typing', I said:

> Python 3 supports type annotations natively

And:

> the mypy tool is an external typechecker that you can run just like any other static analysis tool

I think I was pretty clear that Python is not statically typed.




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

Search: