← All lessons
Python
All Python snippets · 350
Every snippet has its own focus page with an explanation and the output it produces.
Variables & Types · 9
Collections · 18
Control Flow · 12
Functions · 15
Object-Oriented Programming · 21
- Basic Class
- Init & Instance
- Class vs Instance
- Basic Inheritance
- Super Init
- Multiple Inheritance MRO
- String Representation
- Operator Overloading
- Missing Bool
- Getter Property
- Validating Setter
- Recursive Setter
- Basic Dataclass
- Frozen Dataclass
- Default Factory
- Classmethod Decorator
- Alternative Constructor
- Static vs Class
- ABC Basics
- Interface Enforcement
- Instantiation Error
Advanced Typing · 21
- Union Types
- Optional Returns
- Pipe Operator
- TypeVar
- Generic Class
- Runtime Erasure
- Callable Type
- Protocol Class
- Protocol Runtime Check
- Literal Type
- TypedDict Structure
- TypedDict Mutation
- @overload Decorator
- Typed Getitem
- Missing Implementation
- ParamSpec Basics
- Decorator Preservation
- ParamSpec Concat
- User Defined TypeGuard
- Complex Narrowing
- Runtime vs Static