@rwnobrega to [email protected] • 2 years agoPython interfaces: abandon ABC and switch to Protocolslevelup.gitconnected.commessage-square9arrow-up114arrow-down13
arrow-up111arrow-down1external-linkPython interfaces: abandon ABC and switch to Protocolslevelup.gitconnected.com@rwnobrega to [email protected] • 2 years agomessage-square9
minus-squareRiskablelinkfedilinkEnglish2•2 years agoI wouldn’t say Protocols are more “fragile”… They’re more strict.
minus-square@[email protected]linkfedilinkEnglish1•2 years agoThe opposite is true. If you have two interfaces that contain methods with the same name, then they have the same typing.Protocol. It is not possible to specify preconditions or contracts, as you would with abc.
I wouldn’t say Protocols are more “fragile”… They’re more strict.
The opposite is true. If you have two interfaces that contain methods with the same name, then they have the same
typing.Protocol
. It is not possible to specify preconditions or contracts, as you would with abc.