Then - ignoring dunders that have weird rules - what, pray tell, is the point of protocols, other than backward compatibility with historical fragile ducks (at the cost of future backwards compatibility)? Why are people afraid of using real base classes?
The fact that it is possible to subclass a Protocol
is useless since you can't enforce subclassing, which is necessary for maintainable software refactoring, unless it's a purely internal interface (in which case the Union
approach is probably still better).
That PEP link includes broken examples so it's really not worth much as a reference.
(for that matter, the Sequence
interface is also broken in Python, in case you need another historical example of why protocols are a bad idea).