no opinion on tuple assignment parentheses?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 41.8k
- Forks
- 2.9k
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 9
Description
This might be intentional but it feels like an omission, so I'm reporting it.
Does Black not have an opinion on parentheses around tuples, when assigning or returning? The following file remains untouched:
(a, b, c) = 1, 2, 3
a, b, c = (1, 2, 3)
return (d, e, f)
return 1, 2, 3
I would expect the optional parentheses would be removed in all above cases, per this: "In those cases, parentheses are removed when the entire statement fits in one line, or if the inner expression doesn't have any delimiters to further split on."
Operating system: Linux Mint
Python version: 3.6
Black version: 18.6b4
Does also happen on master: yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Reproduce the four Python examples with Black 18.6b4 or current master, compare the output with the quoted parenthesis rule, and trace the formatter behavior for tuple assignment and return statements. Done means the chosen behavior is covered by regression tests and is consistent with Black's documented formatting rules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100