Summary
As Python developers we are fond of the dynamic nature of the language. Sometimes, though, it can get a bit too 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.
Brief Introduction
Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.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 pythonpodcast.comLinode is sponsoring us this week. Check them out at linode.com/podcastinit and get a $20 credit to try out their fast and reliable Linux virtual servers for your next projectWe 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 getsentry.comVisit our site to subscribe to our show, sign up for our newsletter, read the show notes, and get in touch.To help other people find the show you can leave a review on iTunes, or Google Play Music, and tell your friends and co-workersJoin our community! Visit discourse.pythonpodcast.com for your opportunity to find out about upcoming guests, suggest questions, and propose show ideas.Your hosts as usual are Tobias Macey and Chris PattiToday we’re interviewing David Fisher and Greg Price about Mypy, a library for adding optional static types to your Python code.Interview with David Fisher and Greg Price
IntroductionsHow did you get introduced to Python? – ChrisCan you explain a bit about what Mypy is and its origin story? – TobiasWhat are the benefits of using Mypy for both new and existing projects? – TobiasHow does the Mypy compilation step work? – TobiasWhat are the biggest technical challenges in implementing Mypy? – ChrisAre 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? – TobiasIn 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? – TobiasType theory is a large and complex problem domain. Can you explain where Mypy falls in this space? – TobiasWhich language(s) had the biggest influence on the particular syntax and semantics used in Mypy? – TobiasWhat kinds of type definitions and guarantees can be encoded using Mypy? – TobiasCan you talk a bit about user defined types as implemented in Mypy? – ChrisHow has the inclusion of the typing module in the Python standard libary influenced the evolution of Mypy? – TobiasDid the inclusion of multiple inheritance add any implementation complexity to Mypy? – ChrisDo you know of any formal studies that have been performed to research the ergonomics or efficiency gains of static or gradual type systems? – TobiasWhat does the future roadmap for Mypy look like? – TobiasKeep In Touch
DavidGitHubweb pageGitHubBug reports, feature requests, questions welcome on issue tracker: github.com/python/mypy
Picks
TobiasFunctional Geekery – Andreas Stefik episode about studies performed on the human factors of developmentSoft Skills Engineering PodcastGrimm Artisenal Ales Lucky Cloudjq – json swiss army knifefzf – a fuzzy finderThinking, Fast And Slow by Daniel KahnemanRingworldOn Proof and Progress in Mathematics, essay by Bill ThurstonAxiomatic by Greg EganLinks
GitHub repo, and CONTRIBUTING filePEP 484PyCon 2016 workshop slidesTypeshed shared repo for stubsOther tools (PyCharm, pylint, pytype, …) using PEP 484 typesThe intro and outro music is from Requiem for a Fish The Freak Fandango Orchestra / CC BY-SA