Re:Ty: A fast Python type checker and language server
by maleldil on Thursday May 08, 2025 @01:34PM
(#43928827)
If I understand correctly, defining the protocol like this forces the implementation classes to have the members as proper fields and disallows properties. If you define `diameter` as a property in the protocol, it supports both:
Pyright output:
That is to say, I find Python's support for structural typing to be limited in practice.
[ Parent
| on HN ]
There are no comments on this comment yet.