3 ms·
Often called sum types, it's really convenient when your language supports both building these kinds of enums as well as destructuring them with pattern matchin
by habitue 6y ago
Often called sum types, it's really convenient when your language supports both building these kinds of enums as well as destructuring them with pattern matching.
If you don't have destructuring, they're less attractive. There's a proposal to add destructuring to python[1] so we'll see
[1] https://www.python.org/dev/peps/pep-0634/ https://www.python.org/dev/peps/pep-0634/