You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add guidelines on multiple assignments in a single line #80
That case seems beyond the scope of this issue.
Since this is about multiple assignments on a single line."
I agree that for blocks it can be occasionally useful.
the reason i don't like it is for: a, b = c(), d()
the reading order I end up having is either: a, c, b, d or c, a, d, b.
Because I want to know what is assigned to what.
both of which are easier with
a = c()
b = d()
I guess another way to describe this rule would be "Do not create tuples just to unpack them on the same line" ?
Activity
omus commentedon Dec 11, 2020
I think multiple assignments from a single call is okay (unpacking):
but multiple assignments from multiple calls should probably be avoided.
fchorney commentedon Nov 30, 2021
I agree with omus.
mcabbott commentedon Nov 30, 2021
What about the following pattern:
IIRC there are cases where one assignment outside an
ifstatement infers better than separate assignments inside it.oxinabox commentedon Nov 30, 2021
That case seems beyond the scope of this issue.
Since this is about multiple assignments on a single line."
I agree that for blocks it can be occasionally useful.
oxinabox commentedon Nov 30, 2021
the reason i don't like it is for:
a, b = c(), d()the reading order I end up having is either:
a, c, b, dorc, a, d, b.Because I want to know what is assigned to what.
both of which are easier with
I guess another way to describe this rule would be "Do not create tuples just to unpack them on the same line" ?