Mypy Blog

mypy-lang.blogspot.com · Company blog · on HN since 2013

The official blog of the mypy project, announcing releases of the optional static type checker for Python.

What HN saysHN links it for mypy release news and Dropbox's PyAnnotate announcement, which commenters compare with other type annotation tools like MonkeyType.
27HN people shared it
5linked it in comments
29stories submitted
434story points
6 months agolast shared
2013people per year2026

Most-shared posts

  1. 1
    Mypy 1.6
    2 people · 24 points · first shared 2023 · 3 comments on HN
  2. 2
    Mypy 0.900 Released
    2 people · 7 points · first shared 2021 · 3 comments on HN
  3. 3
    Mypy 0.700 Released: Up to 4x Faster
    2 people · 5 points · first shared 2019 · discussion on HN
  4. 4
    Mypy 0.530 Released
    2 people · 2 points · first shared 2017 · discussion on HN
  5. 5
  6. 6
    Typed Python: new Mypy release
    1 people · 156 points · first shared 2016 · 46 comments on HN
  7. 7
    PyAnnotate – Auto-generate type annotations for mypy
    1 people · 129 points · first shared 2017 · 33 comments on HN
  8. 8
  9. 9
    Mypy 1.0 Released
    1 people · 7 points · first shared 2023 · discussion on HN
  10. 10
    Mypy 1.7 Released
    1 people · 3 points · first shared 2023 · discussion on HN
  11. 11
    Mypy 0.740 Released
    1 people · 3 points · first shared 2019 · discussion on HN
  12. 12
    Mypy 1.5 Released
    1 people · 2 points · first shared 2023 · discussion on HN
  13. 13
    Mypy Switches to Python-Compatible Syntax
    1 people · 2 points · first shared 2013 · discussion on HN
  14. 14
    Mypy 0.520 Released
    1 people · 2 points · first shared 2017 · discussion on HN
  15. 15
    Mypy 0.660 Released
    1 people · 2 points · first shared 2019 · discussion on HN

What HN people wrote when they linked it

syastrov · 2019-03-24
Django has quite a lot of "magic" as well. There is work being done on a mypy plugin to support this magic in addition to type stubs. It is already quite usable and supports type-checking many common patterns: https://github.com/mkurnikov/django-stubs See also mypy's recent blog post on plugins (which are also used for supporting Python 3.7's dataclasses, which are quite dynamic as well): http://mypy-lang.blogspot.com/2019/03/extending-mypy-with-plugins.html
JosephRedfern · 2017-12-21
This sounds similar to Dropbox's PyAnnotate -- Guido van Rossum writes about it here: http://mypy-lang.blogspot.co.uk/2017/11/dropbox-releases-pyannotate-au… Would be interesting to see how MonkeyType and PyAnnotate compare.
pixelmonkey · 2015-11-25
It's cool that PyCharm added support for this -- the point of the typing module and the type hinting PEP is for IDEs to adopt it for linting purposes. For those of you using vim, emacs, and the standard UNIX editing toolchain, the mypy linter provides command-line support. This blog post from April 2015 describes the first version of mypy that includes support for the official typing library. http://mypy-lang.blogspot.co.uk/2015/04/mypy-02-released.html
kirbyfan64sos · 2022-04-22
> There is no way to get typing like dataclasses without writing your own mypy plugin. The syntax is simply not expressive enough to do it. This means that if you want to be productive with a library like Pydantic, you also have to add the mypy plugin to your dependencies and add it to your mypy config. Otherwise, no typing. This would be solved by PEP 681, which originates from (and is already used in) pyright: https://peps.python.org/pep-0681/ > 3. To this day, there is still no way to express optional keys. Not "Optional" keys, but keys that can be left out of your dictionary. The closest you can get is this weird hack where you can set `total=False` in your TypedDict, which makes all keys optional. This is solved by PEP 655, which introduces NotRequired: https://peps.python.org/pep-0655/ It's implemented in mypy 0.930: https://mypy-lang.blogspot.com/2021/12/mypy-0930-released.html > I really wish Python learned from Typescript, but it's too late at this point Personally, I feel like it's partly just entirely different styles: Python relies on a mix of nominal and duck types, whereas JavaScript is much more focused on structural typing. As a result, there are a lot of things like TypedDict that are absolutely essential for JS to even function but a decent bit less so in idiomatic Python code (keeping a significant amount of dicts around uses much more memory than objects, I recall a PyCon talk explicitly mentioning this too).

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close