Re:Reasons to avoid static type checking
by trashburger on Sunday January 28, 2024 @06:06AM
(#39164487)
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.
[ Parent
| on HN ]
Re:Reasons to avoid static type checking
by alanwreath on Monday January 29, 2024 @08:51AM
(#39176217)
Not 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/