Instagram / Instagram/LibCST

CSTTransform.on_leave type definitions are too strict

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

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.