Should Concrete Classes Inherit from a Protocol ? #1477
othmane099
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In Python, Protocol allows defining interfaces for classes. Consider the
Transport
protocol, which specifies methods for login/logout responses, and a concrete classBearerTransport
that implements these methods.Is it necessary for
BearerTransport
to inherit fromTransport
? If yes, why isTransport
defined as a Protocol?Beta Was this translation helpful? Give feedback.
All reactions