We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Static typing: beyond the basics of def foo(x: int) -> str:

Formal Metadata

Title
Static typing: beyond the basics of def foo(x: int) -> str:
Subtitle
Exploring the practicalities of explaining complex code to mypy
Title of Series
Number of Parts
118
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
The Python community has been warming up to static typing for a few years now. You may have seen talks that did a great job of introducing the basic concepts, mypy, and high-level strategies to cover existing code bases. We need to go deeper. Let’s talk about the challenges you inevitably encounter when you try to type-check a large code base. One full of many moving parts, complex architectures, metaprogramming tricks, and interfaces with a dozen other packages. Static type checking is very powerful – when you use it to maximum advantage and explain your code to the typechecker accurately. We will cover a few tools at your disposal: generics, signature overloads, protocols, custom mypy plug-ins, and more. There is more than just tools, though. Behind them all are universal concepts valid in any language. I hope to convince you that thinking in terms of the type system helps you write better code…
Keywords