Hacker News new | ask | show | jobs
by jefftk 1861 days ago
> I think we should be teaching static types and I pushed for Typescript

Another option would be to introduce Python types:

    def square(x: int) -> int:
      return x*x
http://mypy-lang.org/examples.html
1 comments

Is there something like DefinitelyTyped for Python? TypeScript only became useful once the ecosystem reached a critical mass of type definitions available for popular libraries.

At the moment the Python community seems pretty anti-static-types, and the core scientific libraries (numpy, matplotlib, pytorch) don't export type signatures. Language server / intellisense support for type inference also has a long way to go.

Not that I am aware of. You can create you own types like what has happened with boto3 [1]

I would assume as types become used more a definitely typed type project will happen on pypi.

[1] https://pypi.org/project/boto3-type-annotations/