Re:Structural pattern matching in Python 3.10
by azkae on Tuesday September 21, 2021 @08:32AM
(#28604383)
You can already do this without pattern matching:
mypy returns an error if you don't handle all cases.
[ Parent
| on HN ]
Re:Structural pattern matching in Python 3.10
by incrudible on Tuesday September 21, 2021 @09:29AM
(#28604839)
The difference is that in Typescript, this works on any structurally matching object that you may get e.g. through JSON.