- Wed 14 September 2022
- Python
- Grant Paton-Simpson (with Ben Denham)
Walrus Hunting with StrEnum
The Walrus operator finally seemed to have found a practical use case - as a way to make collections of strings or integers without as much boiler plate as the alternative without the operator. But Python has a better approach already - Enum - and in Python 3.11 it is even easier to use with strings (StrEnum). So the Walrus operator still struggles to find a problem for which it is the best solution.