News for hackers. Stuff that matters.
Re:Adoption of Mypy for Python type checking: 45% already us... by redsymbol on Sunday March 21, 2021 @10:04AM (#26530526)
Important to realize glyph's twitter followers are not representative of all Python users.

In general, people who follow him are going to be more "into" Python than someone who just uses it to get their job done, and thus more likely to use optional tooling with a large overhead like mypy.

That will skew the results in favor of mypy in this poll. Though the poll getting on the HN front page will balance that somewhat.

Re:Adoption of Mypy for Python type checking: 45% already us... by watermelon0 on Sunday March 21, 2021 @10:44AM (#26530814)
I'm just using it to get my job done, and really couldn't imagine working with Python without it.

I'd consider static type checker as optional if you are playing around with small or throwaway scripts, but for any half serious project, it should be a requirement.

IME I don't consider it slow, and it's definitely not visibly slower than pylint, flake8, or similar tools for other languages.

Dropbox, which has one of the biggest Python codebases, uses it, and most mypy maintainers including Guido work there.

Re:Adoption of Mypy for Python type checking: 45% already us... by Twirrim on Sunday March 21, 2021 @11:08AM (#26531006)
> Dropbox, which has one of the biggest Python codebases, uses it, and most mypy maintainers including Guido work there.

Guido hasn't worked at Dropbox since 2019. He retired for a bit, but is now in the Developer Division at Microsoft.

Re:Adoption of Mypy for Python type checking: 45% already us... by watermelon0 on Sunday March 21, 2021 @11:25AM (#26531127)
My bad, I just checked http://mypy-lang.org/about.html, which appears to be outdated.
Re:Adoption of Mypy for Python type checking: 45% already us... by bostonsre on Sunday March 21, 2021 @03:23PM (#26533110)
Yea, it may slightly slow down the initial draft due to needing to type a little bit more, but it helps speed up maintainability and readability a ton and it helps eliminate a bunch of bugs so I think it has definitely increased productivity in my experience.
Re:Adoption of Mypy for Python type checking: 45% already us... by you_are_naive on Sunday March 21, 2021 @11:02AM (#26530961)
The biggest problem with mypy is that it's written in python. It's slow. It needs to be rewritten in rust or go to make it faster like how js ecosystem is moving in that direction. All the tooling is moved to faster compiled languages.
Re:Adoption of Mypy for Python type checking: 45% already us... by watermelon0 on Sunday March 21, 2021 @11:29AM (#26531156)
mypy is actually compiled via mypyc, which should be a few times faster than interpreted Python https://github.com/python/mypy/tree/master/mypyc
Re:Adoption of Mypy for Python type checking: 45% already us... by crazypython on Sunday March 21, 2021 @11:06AM (#26530987)
mypy has implementations in other languages – PyCharm's is in Java, Facebook's Pyre's is in OCaML https://github.com/facebook/pyre-check
Re:Adoption of Mypy for Python type checking: 45% already us... by MapleWalnut on Sunday March 21, 2021 @11:52AM (#26531306)
Those tools are not re-implementations of mypy, but their own type checkers. Pyre doesn't necessarily have all the features of mypy and vice versa.
Re:Adoption of Mypy for Python type checking: 45% already us... by wk_end on Sunday March 21, 2021 @02:17PM (#26532545)
Initial type checking with mypy is slow, but if you use mypy-daemon each check after that becomes pretty much instantaneous, even on 10M+ line code bases.
Re:Adoption of Mypy for Python type checking: 45% already us... by duxup on Sunday March 21, 2021 @12:14PM (#26531464)
Arguably that applies to all social media ;)

I see a lot of sort of 'programming culture' for given languages, practices, even discussion of working conditions and etc that on social media are taken as standard operating procedure. Highly active and even highly knowledgeable folks seem to portray various practices and etc are a given ... that I suspect are actually outliers.

Re:Adoption of Mypy for Python type checking: 45% already us... by spicybright on Sunday March 21, 2021 @06:42PM (#26534837)
I agree listen to the heavy weights on these sorts of things. But a poll open to everyone is pretty useless.
Re:Adoption of Mypy for Python type checking: 45% already us... by make3 on Sunday March 21, 2021 @01:37PM (#26532200)
One of the first things you learn in theoretical sampling classes is that polls where people self select to participate (like twitter polls) are garbage
Re:Adoption of Mypy for Python type checking: 45% already us... by sitkack on Monday March 22, 2021 @12:38PM (#26543185)
The results are good, they are just, "of the population that uses twitter" ...

What I would really be interested in, is do library developers use or intend to use mypy? Because if your libs are typed checked and your APIs are well constructed, a lot of that safety will flow to the clients.

Maybe those 40% would love to use it if something was changed or fixed. I think these numbers are frankly amazing, a year from now we reach an inflection point where mypy is used by the majority of some segment of the Python developer ecosystem.

Re:Adoption of Mypy for Python type checking: 45% already us... by croh on Sunday March 21, 2021 @10:35AM (#26530752)
Yup agree. People who follow him are more "into" python async stuff.