rwnobrega@lemmy.world to Python@programming.dev · 1 year agoPython interfaces: abandon ABC and switch to Protocolslevelup.gitconnected.comexternal-linkmessage-square10fedilinkarrow-up114arrow-down12
arrow-up112arrow-down1external-linkPython interfaces: abandon ABC and switch to Protocolslevelup.gitconnected.comrwnobrega@lemmy.world to Python@programming.dev · 1 year agomessage-square10fedilink
minus-squareplistig@feddit.delinkfedilinkEnglisharrow-up1·1 year 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.
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.