Skip to content

Protocol practice problems in Python

Difficulty:
Category:
Tag:

Showing 9 of 9

Status Title Difficulty
Callback protocols: closing the Callable[..., Any] hole Medium
ExitStack: all-or-nothing acquisition of N resources Hard
Placement 2/6: Protocol vs ABC Easy
Protocols: what structural subtyping actually asserts Easy
@runtime_checkable checks names, not types Medium
runtime_checkable is presence, not a signature Hard
Subclassing a Protocol: what Python will and will not stop you doing Medium
The protocol attribute invariance trap Hard
Variance in generic protocols Hard