CSTTransform.on_leave type definitions are too strict
Open
machinery
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 229
- PR merge metrics
- No merged PRs in 30d
Description
The type definitions for `CSTTransform.on_leave` https://github.com/Instagram/LibCST/blob/df231f3fa5ac3dfa7b14a30103249e5da79509e3/libcst/_visitors.py#L50-L52 is too strict, as it requires that the return type is exactly the same as the original_node, which is not correct. For example, you could change a literal float to a predefined constant.
Contributor guide
Assessment
This issue has not been assessed yet.