Python — From Basics to Advanced · Advanced Typing
Generic — Parametric Types
Advanced Typing
Introduction
Generic lets you write classes and functions that work with "any type T" while preserving full type information. Stack[int], Stack[str] — the type checker knows exactly what is inside. Foundation for generic containers, decorators, serialisers, and SDKs.