ImportFrom can produce invalid code without parenthesis
Open
bug
parsing
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 229
- PR merge metrics
- No merged PRs in 30d
Description
In fact this is captured as a test case in https://github.com/instagram/libcst/blob/f36eacb1327830fad51e08084b46601cad681ae0/libcst/_nodes/tests/test_import.py#L394-L401
```
cst.ImportFrom(
module=cst.Name("foo"),
names=(
cst.ImportAlias(cst.Name("bar"), comma=cst.Comma()),
cst.ImportAlias(cst.Name("baz"), comma=cst.Comma()),
),
)
```
This node generates `from foo import bar,baz,` which isn't syntactically correct.
Contributor guide
Assessment
This issue has not been assessed yet.