Re:The Languages of English, Math, and Programming
by underdeserver on Sunday October 20, 2024 @09:30AM
(#41895255)
I'm just here to point out that since Python 3.10, you don't need to import anything from typing anymore, you could use the built-in types for annotation:
[ Parent
| on HN ]
Re:The Languages of English, Math, and Programming
by superlopuh on Sunday October 20, 2024 @02:22PM
(#41897391)
The typing version is still useful when you want to communicate that the result conforms to a certain interface, which doesn't include mutability in the case of Set, but not the exact type.
Edit: I see that he imported the typing Set, which is deprecated, instead of collections.abc.Set, which is still useful, so your comment is correct.