3 ms·
`__subclasshook__` is super useful if you're trying to pass a mock when unit testing code that (despite this not being a best practice) checks its inputs with i
by btown 4y ago
`__subclasshook__` is super useful if you're trying to pass a mock when unit testing code that (despite this not being a best practice) checks its inputs with isinstance and checks for a class that is far more complex to instantiate than would be wise for your test. I can't say I've ever seen it used outside of testing code before, though.