Hacker News new | ask | show | jobs
by Atlas22 1269 days ago
Yeah, I think I agree with you. I still find it curious that the python language server is quite capable of inferring types from unannotated code yet most of the type checking tools for python seem to explode as soon as they encounter an very popular yet untyped library. I guess typing is more of an afterthought than a priority for most dynamic language developers so it doesn't get much love.
2 comments

> I still find it curious that the python language server is quite capable of inferring types from unannotated code yet most of the type checking tools for python seem to explode as soon as they encounter an very popular yet untyped library.

There are multiple python language servers, but if you mean the Microsoft one, well, that just incorporates one of the best of the Python static typecheckers (Microsoft’s pyright)

Yeah I was indeed referring to Pylance, the Microsoft one. I was unaware that pyright was used under the hood, thanks.
Sounds like an opportunity for a type checker that uses the language server.
> Sounds like an opportunity for a type checker that uses the language server

The language server itself uses a typechecker, so you'd just be building a typechecker that uses another typechecker by a roundabout route.

It's turtles all the way down.

Though in seriousness I'd presume it would be bad type checker uses language server which uses better type checker, which may help with the problem.