Skip to content

Validation practice problems in Python

Difficulty:
Category:
Tag:

Showing 9 of 9

Status Title Difficulty
batched: page a stream, and validate before you yield Easy
Coerce to int at an untyped boundary Medium
Converters and validate-on-assignment: what attrs buys you Medium
Parse at the boundary, dataclasses in the core Hard
Parse, don't validate: the boundary returns a narrower type Medium
Replacing cast() with a TypeIs predicate Medium
@runtime_checkable checks names, not types Medium
Sequence and mapping patterns: the two rules everyone gets wrong Medium
tomllib: turn dict[str, Any] into a typed config, or a named error Medium