Mypy with David Fisher and Greg Price

The Python Podcast.__init__

Episode | Podcast

Date: Sat, 09 Jul 2016 21:00:00 -0400

<h3>Summary</h3> <p>As Python developers we are fond of the dynamic nature of the language. Sometimes, though, it can get a bit <em>too</em> dynamic and that’s where having some type information would come in handy. Mypy is a project that aims to add that missing level of detail to function and variable definitions so that you don’t have to go hunting 5 levels deep in the stack to understand what shape that data structure is supposed to be. This week we spoke with David Fisher and Greg Price about their work on Mypy and its use within Dropbox and the broader community. They explained how it got started, how it works under the covers, and why you should consider adding it to your projects.</p> <h3>Brief Introduction</h3> <ul> <li>Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.</li> <li>I would like to thank everyone who has donated to the show. Your contributions help us make the show sustainable. For details on how to support the show you can visit our site at <a href="http://pythonpodcast.com?utm_source=rss&amp;utm_medium=rss">pythonpodcast.com</a></li> <li>Linode is sponsoring us this week. Check them out at <a href="http://linode.com/podcastinit?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">linode.com/podcastinit</a> and get a $20 credit to try out their fast and reliable Linux virtual servers for your next project</li> <li>We are also sponsored by Sentry this week. Stop hoping your users will report bugs. Sentry’s real-time tracking gives you insight into production deployments and information to reproduce and fix crashes. Check them out at <a href="https://getsentry.com/welcome/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">getsentry.com</a></li> <li>Visit our site to subscribe to our show, sign up for our newsletter, read the show notes, and get in touch.</li> <li>To help other people find the show you can leave a review on <a href="https://itunes.apple.com/us/podcast/podcast.-init/id981834425?mt=2&amp;uo=6&amp;at=&amp;ct=&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">iTunes</a>, or <a href="https://play.google.com/music/m/I7ogju4xv6adasgqz6545jndgsy?t=Podcastinit_-_Python_and_the_people_who_make_it_great&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Google Play Music</a>, and tell your friends and co-workers</li> <li>Join our community! Visit <a href="https://discourse.pythonpodcast.com?utm_source=rss&amp;utm_medium=rss">discourse.pythonpodcast.com</a> for your opportunity to find out about upcoming guests, suggest questions, and propose show ideas.</li> <li>Your hosts as usual are Tobias Macey and Chris Patti</li> <li>Today we’re interviewing David Fisher and Greg Price about Mypy, a library for adding optional static types to your Python code.</li> </ul> <p>es</p> <h3>Interview with David Fisher and Greg Price</h3> <ul> <li>Introductions</li> <li>How did you get introduced to Python? &#8211; Chris</li> <li>Can you explain a bit about what Mypy is and its origin story? &#8211; Tobias</li> <li>What are the benefits of using Mypy for both new and existing projects? &#8211; Tobias</li> <li>How does the Mypy compilation step work? &#8211; Tobias</li> <li>What are the biggest technical challenges in implementing Mypy? &#8211; Chris</li> <li>Are there any limitations imposed by the syntax of Python that prevented you from implementing any features or syntax that you would have liked to include in Mypy? &#8211; Tobias</li> <li>In Guido’s keynote from this year’s PyCon he mentioned some tentative plans for adding variable type declarations to the Python syntax in one of the next major releases. How much of that idea was inspired by Mypy? &#8211; Tobias</li> <li>Type theory is a large and complex problem domain. Can you explain where Mypy falls in this space? &#8211; Tobias</li> <li>Which language(s) had the biggest influence on the particular syntax and semantics used in Mypy? &#8211; Tobias</li> <li>What kinds of type definitions and guarantees can be encoded using Mypy? &#8211; Tobias</li> <li>Can you talk a bit about user defined types as implemented in Mypy? &#8211; Chris</li> <li>How has the inclusion of the typing module in the Python standard libary influenced the evolution of Mypy? &#8211; Tobias</li> <li>Did the inclusion of multiple inheritance add any implementation complexity to Mypy? &#8211; Chris</li> <li>Do you know of any formal studies that have been performed to research the ergonomics or efficiency gains of static or gradual type systems? &#8211; Tobias</li> <li>What does the future roadmap for Mypy look like? &#8211; Tobias</li> </ul> <h3>Keep In Touch</h3> <ul> <li>David <ul> <li><a href="https://github.com/ddfisher?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">GitHub</a></li> </ul> </li> <li>Greg <ul> <li><a href="http://web.mit.edu/price/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">web page</a></li> <li><a href="https://github.com/gnprice?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">GitHub</a></li> </ul> </li> </ul> <p>$ pip3 install mypy-lang</p> <p>Bug reports, feature requests, questions welcome on issue tracker: github.com/python/mypy</p> <h3>Picks</h3> <ul> <li>Tobias <ul> <li><a href="https://www.functionalgeekery.com/episode-55-andreas-stefik/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Functional Geekery &#8211; Andreas Stefik</a> episode about studies performed on the human factors of development</li> <li><a href="https://twitter.com/softskillseng?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Soft Skills Engineering Podcast</a></li> </ul> </li> <li>Chris <ul> <li><a href="http://grimmales.com/luckycloud/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Grimm Artisenal Ales Lucky Cloud</a></li> <li><a href="https://stedolan.github.io/jq/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">jq &#8211; json swiss army knife</a></li> </ul> </li> <li>David <ul> <li><a href="https://github.com/junegunn/fzf?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">fzf &#8211; a fuzzy finder</a></li> <li><a href="http://amzn.to/28YHvYc?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Thinking, Fast And Slow</a> by Daniel Kahneman</li> <li><a href="http://amzn.to/28YHi7c?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Ringworld</a></li> </ul> </li> <li>Greg <ul> <li><a href="http://www.ams.org/journals/bull/1994-30-02/S0273-0979-1994-00502-6/S0273-0979-1994-00502-6.pdf?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">On Proof and Progress in Mathematics</a>, essay by Bill Thurston</li> <li><a href="http://amzn.to/28Nr0x9?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Axiomatic</a> by Greg Egan</li> </ul> </li> </ul> <h3>Links</h3> <ul> <li>GitHub <a href="https://github.com/python/mypy?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">repo</a>, and <a href="https://github.com/python/mypy/blob/master/CONTRIBUTING.md?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">CONTRIBUTING file</a></li> <li><a href="https://www.python.org/dev/peps/pep-0484/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">PEP 484</a></li> <li><a href="https://dl.dropboxusercontent.com/content_link/CzGrw5JyeBy2m2yGXgYckx25C5F1SISDYueX8f7nXxEuDJO1aCmcNN6kfgHEdzUf/file?dl=1&amp;utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">PyCon 2016 workshop slides</a></li> <li><a href="https://github.com/python/typeshed?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Typeshed</a> shared repo for stubs</li> <li><a href="https://github.com/python/typing/issues/200?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">Other tools (PyCharm, pylint, pytype, …) using PEP 484 types</a></li> </ul> <p>The intro and outro music is from Requiem for a Fish <a href="http://freemusicarchive.org/music/The_Freak_Fandango_Orchestra/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">The Freak Fandango Orchestra</a> / <a href="http://creativecommons.org/licenses/by-sa/3.0/?utm_source=rss&amp;utm_medium=rss" rel="noopener" target="_blank">CC BY-SA</a><img alt="" height="0" src="https://analytics.boundlessnotions.com/piwik.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fwww.pythonpodcast.com%2Fepisode-65-mypy-with-david-fisher-and-greg-price%2F&amp;action_name=Mypy+with+David+Fisher+and+Greg+Price+-+Episode+65&amp;urlref=https%3A%2F%2Fwww.pythonpodcast.com%2Ffeed%2F&amp;utm_source=rss&amp;utm_medium=rss" style="border: 0; width: 0; height: 0;" width="0" /></p>