Is there something like this:
a,b,c = a,b,c.method()
?
It's just an example, I want to know the shortest way to do this
Not exactly that short, but if I understand you correct, this will work:
a, b, c = (x.method() for x in (a, b, c))
(Note, that if a
, b
or c
are referring to the same object, the method will be called few times).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With