Skip to content

Matchers do not match base classes #1366

@AryazE

Description

@AryazE

In

import libcst as cst
import libcst.matchers as m

m.matches(cst.SimpleString("'foo'"), m.SimpleString) # True
m.matches(cst.SimpleString("'foo'"), m.BaseString) # False

I expect both statements to be true. Otherwise, you need to use OneOf or | on all string types. The same applies for numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions