Live data from Hacker News

Mypy 1.6

mypy-lang.blogspot.com

11–20 of 114 posts

Re: Mypy 1.6

#11

I work on a monorepo and MyPy and Flake8 was such a PITA at first but after you use it for a while, you really see the value of type checking. Makes unit testing better and the code more robust in general. MyPy is seriously a great tool, especially with pydoc enforcements.

It makes unit testing better in the sense that it can obsolete a good chunk of it, even.

Re: Mypy 1.6

#12
post #9
post #8

Earlier quoted context omitted.

At that point, why not just use Go? It's designed to feel dynamic, provides concurrency primitives out of the box, and it's orders of magnitude faster for most tasks.

It is a downgrade in language features, there is always PyPy.

If you don't consider static type and built in concurrency primitives features then ok, at what point does nice to have features outweigh performance gains and the robustness of static typing that directly impacts the quality of the end user experience and the readability of the code to other developers?

Re: Mypy 1.6

#13
post #9
post #8

Earlier quoted context omitted.

At that point, why not just use Go? It's designed to feel dynamic, provides concurrency primitives out of the box, and it's orders of magnitude faster for most tasks.

It is a downgrade in language features, there is always PyPy.

In fairness, if you are choosing a language based on language features, you are not going to choose Python either.

Re: Mypy 1.6

#15
post #9

Earlier quoted context omitted.

It is a downgrade in language features, there is always PyPy.

In fairness, if you are choosing a language based on language features, you are not going to choose Python either.

Python is quite rich in language features, C++ like, most people tend to think it is like BASIC, but it definitly isn't.

Re: Mypy 1.6

#16
post #9

Earlier quoted context omitted.

It is a downgrade in language features, there is always PyPy.

In fairness, if you are choosing a language based on language features, you are not going to choose Python either.

Why not? The ecosystem might as well be a language feature, and Python has one of the strongest for a lot of areas, not just ML.

Also, what is Python lacking that other languages have? It's expressive and fast to develop, and with type hints and linters, reasonably robust.

My main complaint is performance, but I'll take the speed to write most days.

Re: Mypy 1.6

#17
post #12
post #9

Earlier quoted context omitted.

It is a downgrade in language features, there is always PyPy.

If you don't consider static type and built in concurrency primitives features then ok, at what point does nice to have features outweigh performance gains and the robustness of static typing that directly impacts the quality of the end user experience and the readability of the code to other developers?

Python has built in concurrency support, stuff like Mypy and IDE tooling make up for the dynamic typing.

And if that isn't enough, the answer is OCaml, F#, D, C#, Java, Scala, Haskell, Kotlin, C++,... definitely not going from horse to donkey in language features.

Re: Mypy 1.6

#18

Is anyone still using mypy, and if so why? I have replaced it by pyright [0] for a while now, and not looking back. It’s been a faster, more powerful replacement with (in my case), zero downside. [0]: https://github.com/microsoft/pyright

Is there any in depth comparison of mypy, pytype, pyright and pyre yet?

They all seem to have slightly different approaches and features, but it's hard to decide which is best for the job.

Re: Mypy 1.6

#19
Has anyone had to choose between Mypy and Pyright? Which is "better"?

A couple years ago I was in charge of choosing between the two, and I somewhat flippantly chose Pyright because it felt a lot faster (Later, I realized that some popular libraries we use (django, numpy) have dedicated plugins for Mypy that you can't use with Pyright. So you have to look for Pyright-friendly type stubs or roll your own.

I've generally liked Pyright (as a side note, they have super responsive maintainers - ask a question on their GH, and they usually answer within a few hours), but I've been wondering if I am missing out with Mypy.

Re: Mypy 1.6

#20

Is anyone still using mypy, and if so why? I have replaced it by pyright [0] for a while now, and not looking back. It’s been a faster, more powerful replacement with (in my case), zero downside. [0]: https://github.com/microsoft/pyright

Is there any in depth comparison of mypy, pytype, pyright and pyre yet? They all seem to have slightly different approaches and features, but it's hard to decide which is best for the job.

Not exactly what you are looking for but maybe useful to others.

https://github.com/microsoft/pyright/blob/main/docs/mypy-com...

Post reply on HN