Instagram / Instagram/LibCST

CSTNode.with_deep_changes type annotation is incomplete

Open
#963 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1.9k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

For example, I want to replace all args of a `Call`:

```
node.with_deep_changes(
old_node=cst.ensure_type(node.value, cst.Call).args, value=[input_arg]
)
```

The code works fine, but the type checker complains:
error: Argument "old_node" to "with_deep_changes" of "CSTNode" has incompatible type "Sequence[Arg]"; expected "CSTNode"

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.