3 ms·
I suppose if python had object destructuring like newish javascript (I think that's what it's called) it would be trivial. I don't know what you'd do instead in
by infogulch 9y ago
I suppose if python had object destructuring like newish javascript (I think that's what it's called) it would be trivial. I don't know what you'd do instead in this case that doesn't involve adding additional methods or something.
- devnonymous 9y agoObject destructuring is tuple unpacking in python which is exactly what the code example does. What the parent was remarking on was caring about the performance of that rather than the ability.
- the_mitsuhiko 9y agoExcept in javascript you can unpack by name. This would solve this issue as well.