Friday, 2 March 2018

Mypy 0.570 Released

We’ve just uploaded mypy 0.570 to the Python Package Index (PyPI). This release includes new features, bug fixes and library stub (typeshed) updates. You can install it as follows:

    python3 -m pip install -U mypy

You can read the documentation for this release on ReadTheDocs.

We're also happy to welcome long-time mypy core dev Ivan Levkivskyi to the mypy team at Dropbox.

New Features

  • Type check class decorators (David Euresti, PR 4544)
  • Plugin for typechecking classes generated by attrs (Documentation) (David Euresti)
  • Hooks into the semantic analyzer for plugins (PR 4328, PR 4397) (David Euresti)

Notable Bugs Fixed

  • Allow calling instances of tuple subclasses that define __call__ (PR 4367)
  • Improve handling of callable() (PR 4343)
  • Fix crashes due to improper handling of type variables (PR 4384)
  • Various stubgen bugs fixed (PR 4407, PR 4467, PR 4518) (hoefling)
  • Allow subtypes to define more overloads than their supertype (Ryan Gonzalez, PR 3263)
  • Fix typing of assignment to list (e.g. [a, b] = foo()) (Elazar Gershuni, PR 4340)
  • Don’t generate --warn-return-any warnings from binary magic methods that raise NotImplementedError (Vlad Starostin, PR 4545)
  • Fix false negatives in incremental mode due to missing dependencies on parent classes (PR 4566)
  • Fix type of forward reference to a decorated class method (PR 4486)
  • Have divmod() properly dispatch to __[r]divmod__ methods (David Euresti, PR 4585)
  • Fix setup.py breakage (yed podtrzitko, PR 4570)
  • Fix platforms in setup.py (Thomas Grainger, PR 3765)
  • Make psutil an optional dependency (Dominik Miedziński, PR 4634)

Improved Error Messages

  • Give faster feedback by streaming error messages incrementally during type checking (PR 4396)
  • Add variable name to "Need type annotation for variable" error (Elliott Beach, PR 4496)
  • Report columns as 1-based, not 0-based (Elliott Beach, PR 4482)
  • Display argument name, not number, for functions called with keyword arguments (Elliott Beach, PR 4504)

Other Changes

  • Document Generator/Iterator distinction (Carl Meyer, PR 4424)
  • Consistently exit with code 2 on blocking errors (PR 4449)
  • Allow unrecognized flags beginning with x_ in mypy.ini, for use in configuring linters and other tools that work with mypy (PR 4521)
  • Refactor and clean up test discovery (Elazar Gershuni, PR 3973)
  • Remove the home-rolled myunit testing framework (Elazar Gershuni, PR 4369)
  • Test cases for enum iteration (Nick Gaya, PR 4400)

Acknowledgments

First of all, we’d like to thank our employer, Dropbox, for funding the mypy core team.

Thanks to all mypy contributors who contributed to this release:

  • a4ff7810
  • Amit D
  • Ashwini Chaudhary
  • Carl Meyer
  • David Euresti
  • Dominik Miedziński
  • Elazar Gershuni
  • Elliott Beach
  • Ethan Smith
  • Germano Gabbianelli
  • Guilherme Caminha
  • hoefling
  • Jelle Zijlstra
  • Nick Gaya
  • Ryan Gonzalez
  • Thomas Grainger
  • Vlad Starostin
  • yed podtrzitko

Additional thanks to all contributors to typeshed:

  • Alan Du
  • Alex Dehnert
  • Anthony Sottile
  • Ashwini Chaudhary
  • Asim Goheer
  • Can Berk Güder
  • Carl Meyer
  • Chad Dombrova
  • Daniel Bowman
  • Daniel Bowtell
  • Daniel Li
  • David Euresti
  • David Zbarsky
  • Elazar Gershuni
  • Elliott Beach
  • Erwin Janssen
  • Ethan Smith
  • Garrett
  • George King
  • gossrock
  • Han Song
  • Ilya Kulakov
  • James M. Allen
  • Jason Fried
  • Jelle Zijlstra
  • Karl Ramm
  • Łukasz Langa
  • Mark Amery
  • Martin DeMello
  • Marti Raudsepp
  • Matt Bogosian
  • Matthias Kramm
  • Michael Lee
  • Michel Albert
  • Nathan Henrie
  • Neil Conway
  • Nick Gaya
  • NODA, Kai
  • PeterJCLaw
  • Pradyun Gedam
  • rchen152
  • Rhys Parry
  • Rick Kilgore
  • Roy Williams
  • Salvo 'LtWorf' Tomaselli
  • Sebastian Rittau
  • Semyon Proshev
  • shahin
  • Thomas Broadley
  • Yuri Khan

--Michael J. Sullivan, on behalf of the mypy team