Instagram / Instagram/LibCST

`Assign.value` has incorrect type annotation

Open
#501 4 comments 0 reactions 1 assignee Claimed by @iamkb28 View on GitHub
documentation good first issue parsing
Dominant language
Python
Stars
1.9k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

According to [the docs](https://libcst.readthedocs.io/en/latest/nodes.html#libcst.Assign.value) `Assign.value` is supposed to be a `BaseExpression`, but:

```
echo "f = *2" | python -m libcst.tool print -
Module(
body=[
SimpleStatementLine(
body=[
Assign(
targets=[
AssignTarget(
target=Name(
value='f',
),
),
],
value=StarredElement(
value=Integer(
value='2',
),
),
),
],
),
],
)
```

And `StarredElement` is not a `BaseExpression`.

I think `value: BaseExpression | StarredElement` is both more accurate and backwards-compatible, so this should be an easy fix.

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.