Hacker News new | ask | show | jobs
by the_af 1269 days ago
Last time I argued, like the TFA does, that Python's typing system is both too complex for casual users and useless for power users ("it doesn't do anything" is about right), and that this makes it hard to evangelize its use to other devs who aren't sold on type systems ("but this doesn't do anything!"), I got into a 30-level nesting flame war with some HN regular who just wouldn't let go.

So that's still my line of thought, but I'm already regretting typing this on HN.

2 comments

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.
> 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.

Too complex for casuals and not powerful enough for power users is a phenomenal way of putting it.