Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Protocol - The Keystone of Type Hints

PyCon US via YouTube

Overview

Explore the importance of PEP 544 and Protocols in Python's static type system in this 28-minute PyCon US talk by Luciano Ramalho. Dive into the concept of structural subtyping and static duck typing, understanding how typing.Protocol enhances the expressiveness of type hints. Learn how this feature enables correct annotation of Pythonic APIs and standard library functions. Examine real-world examples from the typeshed project, progressing from basic concepts to more complex applications. Gain insights into static vs. dynamic typing, annotations, numeric unions, restricted type variables, and syntax. Discover how Protocols serve as the keystone for Python type hints, improving code verification by static type checkers and IDEs.

Syllabus

Introduction
Static vs Dynamic typing
The problem
Annotations
Number ABC
Numeric Union
Restricted Type var
Syntax
Solution

Taught by

PyCon US

Reviews

Start your review of Protocol - The Keystone of Type Hints

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.