3 ms·
I was mostly talking about the placeholders (hence style), but > ("lhs=({}, {}); rhs=({}, {})", lhs.x, lhs.y, rhs.x, rhs.y) Python 3.6 added "natively interpo
by masklinn 9y ago
I was mostly talking about the placeholders (hence style), but
> ("lhs=({}, {}); rhs=({}, {})", lhs.x, lhs.y, rhs.x, rhs.y)
Python 3.6 added "natively interpolated" f-strings, just replace C#'s `$` prefix by `f`, and even without f-strings you could write e.g.
"lhs=({lhs.x}, {lhs.y}); rhs=({rhs.x}, {rhx.y})".format(lhs=lhs, rhs=rhs)
Rust supports named parameters but IIRC not attribute access or method calls.
- steveklabnik 9y agoYes, you can't do something like this in Rust, you'd be doing what's in the quote above; named params are it. You have to do the attribute access/method call when binding the parameter, not applying it to a parameter somehow.