RetroFed Forum
Your home away from modern life.
Static Protocols in Python: Behaviour Over Inheritance
Post Reply
AuthorMessage
Rimu piefed.social rimu@piefed.social
Joined: 2024-01-04
Quote

Protocols have something to do with typing. With protocols, you can check whether an object is valid based on whether it has the right methods and attributes. The idea is to check for behaviour instead of inheritance. Protocols extend Python's type hints by allowing to define structural types.

2   Original
Post Reply
Back to top