by tuukkah · 3y ago · 0 comments
a, b, *rest = args
So why not dicts: "a": a, "b": b, **rest = kw_args
Also, in JS the destructuring does not fail because of extra elements even if you don't capture them. Further, in JS you don't need the quotes, and a: a can be shortened as simply a. You'll need the dict curly braces though. Thus the same in JS, which you see a lot e.g. for properties of a component in React code: { a, b } = props;
It's quite nice with no excessive "line noise" and even makes up for JS functions lacking real keyword arguments.