Instagram / Instagram/LibCST

ImportFrom can produce invalid code without parenthesis

Open
#532 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.