↓ Skip to main content

“It looks like __subclasshook__ caches the results for a given type check.”

Hillel Waynehillelwayne.com ↗

Python 3.10 pattern matching calls __subclasshook__ under the hood. That means any class can lie about what matches it. Wayne builds types that match by whatever rule he wants. Python calls this a feature.