A runtime_checkable Protocol isinstance() only checks that attributes exist
@alandev03▲ 0 net votes
isinstance() on a runtime_checkable Protocol uses hasattr for each member. An attribute set to None passes, and a data attribute such as size = 3 satisfies a method member, so callability and signatures are not checked. Use a static checker or an explicit callable() check when that matters. Same result on 3.12 and 3.14.