You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to visit the name nodes inside the import nodes using MatcherDecoratableTransformer. For each of node I'm visiting, I'd like to check against a list of items to skip the visit. I'm trying to use the following code to achieve this:
Traceback (most recent call last):
File "do_not_match.py", line 15, in <module>
trans = InvertTransformer()
^^^^^^^^^^^^^^^^^^^
File "libcst/matchers/_visitors.py", line 482, in __init__
_check_types(
File "libcst/matchers/_visitors.py", line 227, in _check_types
possible_match_classes = _get_possible_match_classes(matcher)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "libcst/matchers/_visitors.py", line 87, in _get_possible_match_classes
return [getattr(cst, matcher.__class__.__name__)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'libcst' has no attribute '_InverseOf'
Comparing to using if m.matches(m.Name("b")): return updated inside the function body, which is the more preferred way to achieve the goal?
The text was updated successfully, but these errors were encountered:
I'm attempting to visit the name nodes inside the import nodes using
MatcherDecoratableTransformer
. For each of node I'm visiting, I'd like to check against a list of items to skip the visit. I'm trying to use the following code to achieve this:An exception is thrown:
Comparing to using
if m.matches(m.Name("b")): return updated
inside the function body, which is the more preferred way to achieve the goal?The text was updated successfully, but these errors were encountered: