CSTNode.deep_replace type annotations incomplete
Open
bug
machinery
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 229
- PR merge metrics
- No merged PRs in 30d
Description
Using `module.deep_replace()` with `RemovalSentinel.REMOVE` or `FlattenSentinel` results in a typecheck error because the second parameter to `deep_replace` is only annotated as accepting `CSTNodeT`, even though it wraps a transformer that accepts the remove/flatten sentinels.
```
src/fixit/engine.py:121: error: Argument 2 to "deep_replace" of "CSTNode" has incompatible type "Union[CSTNode, FlattenSentinel[Any], RemovalSentinel]"; expected Module [arg-type]
```
Contributor guide
Assessment
This issue has not been assessed yet.