27 ms·
> Named tuples, the example I called out, are a good improvement over dicts for adhoc structs that don’t require full class definitions. Doesn't a lot of that
by nemetroid 6y ago
> Named tuples, the example I called out, are a good improvement over dicts for adhoc structs that don’t require full class definitions.
Doesn't a lot of that improvement come from the fact that they have a name, though? I guess you could argue for an "UnnamedTuple" which only enforces tuple size and member names. But if you're able to specify the member names, it feels like the thing being represented is concrete enough that you should be able to come up with a name for it, and that having a name would be beneficial.