3 ms·
This is my single greatest complaint about Python's type system. Protocol should have always been the primary building block rather than just being relegated to
by trashburger 3y ago
This is my single greatest complaint about Python's type system. Protocol should have always been the primary building block rather than just being relegated to something you use for "duck typing". Subtyping fits much better with things like the dynamic approach of the Django ORM, for example.
- alanwreath 3y agoNot sure what you mean, while it’s true that it would have been nice that Protocols were always the primary building block, as of python 3.8 they _can_ be depending on your use of Structural Typing https://peps.python.org/pep-0544/ https://peps.python.org/pep-0544/