Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compare_singleton_primitives_by_is): compare Name directly instea…
…d of QualifiedName (#391) fixes #378 and #375 which are caused by Instagram/LibCST#389. Qualifying a name will never make some thing that wasn't already True/False/None into a True/False/None: ```python import libcst as cst from libcst.metadata.name_provider import QualifiedNameProvider from textwrap import dedent wrapper = cst.MetadataWrapper( cst.parse_module(dedent( ''' x = None x() ''' )) ) x_ref = wrapper.module.body[1].body[0].value print(wrapper.resolve(QualifiedNameProvider)[x_ref]()) ``` prints: ```python {QualifiedName(name='x', source=<QualifiedNameSource.LOCAL: 3>)} ``` Co-authored-by: Amethyst Reese <amethyst@n7.gg>
- Loading branch information