Skip to content

Commit

Permalink
Use cls, not class_
Browse files Browse the repository at this point in the history
This is the standard, pyright was throwing a warning
  • Loading branch information
NickCrews committed Jun 1, 2023
1 parent b7d4027 commit a350cd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docopt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def __init__(
self.value = None if value is False and argcount else value

@classmethod
def parse(class_, option_description: str) -> _Option:
def parse(cls, option_description: str) -> _Option:
short, longer, argcount, value = None, None, 0, False
options, description = re.split(
r"(?: )|$", option_description.strip(), flags=re.M, maxsplit=1
Expand All @@ -308,7 +308,7 @@ def parse(class_, option_description: str) -> _Option:
if argcount:
matched = re.findall(r"\[default: (.*)\]", description, flags=re.I)
value = matched[0] if matched else None
return class_(short, longer, argcount, value)
return cls(short, longer, argcount, value)

def single_match(self, left: list[_LeafPattern]) -> _SingleMatch:
for n, pattern in enumerate(left):
Expand Down

0 comments on commit a350cd9

Please sign in to comment.