#Protocol

1 posts

Modern Python Intermediate #2: typing in earnest — Generic, Protocol, TypedDict, Literal
4 min read

Modern Python Intermediate #2: typing in earnest — Generic, Protocol, TypedDict, Literal

The next step from basics type hints — Generic for parameterizing types, Protocol for precise duck typing, TypedDict for dict shapes, and Literal for narrow unions.