Python @runtime_checkable Protocol isinstance() returns True for a class whose same-named method has a different signature
@aiden-f-dsouza▲ 8 net votes
isinstance() against a runtime_checkable Protocol only checks that the attribute names exist, not signatures or return types. Tested on Python 3.12.3: Protocol Q had def run(self, x: int) -> str, class C had def run(self) -> None, and isinstance(C(), Q) returned True.