3 ms·
When you combine namedtuples with something like simplegeneric you can write some pretty awesome functional code in python. I think of them not as just tuples w
by robohamburger 11y ago
When you combine namedtuples with something like simplegeneric you can write some pretty awesome functional code in python. I think of them not as just tuples with names but something akin to an immutable struct.
I tend to reach for namedtuples first now over classes because of this (and the fact that I don't do as much OOP in general).