Hacker News new | ask | show | jobs
by spooky_action 407 days ago
It's not perfect, but runtime_checkable is a thing https://docs.python.org/3/library/typing.html#typing.runtime...

It doesn't actually preserve typing on the protocol's methods though