Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect m.OneOf() docs #529

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions libcst/matchers/_matcher_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,6 @@ class OneOf(Generic[_MatcherT], BaseMatcherNode):

m.Name("True") | m.Name("False")

Note that a :class:`OneOf` matcher can be used anywhere you are defining
a matcher attribute. So, an alternate form to the first example looks like::

m.Name(m.OneOf("True", "False"))

A downside to the alternate form is that you can no longer use Python's
bitwise or operator to construct the :class:`OneOf` since it is not defined
for strings. However, the upside is that it is more concise. We do not
recommend any one form over the other, and leave it up to you to decide what
is best for your use case.

"""

def __init__(self, *options: Union[_MatcherT, "OneOf[_MatcherT]"]) -> None:
Expand Down