From a350cd9c308872271336946e00a9b600034529b6 Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Thu, 1 Jun 2023 10:11:39 -0800 Subject: [PATCH] Use cls, not class_ This is the standard, pyright was throwing a warning --- docopt/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docopt/__init__.py b/docopt/__init__.py index 0dd9433..13a66b7 100644 --- a/docopt/__init__.py +++ b/docopt/__init__.py @@ -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 @@ -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):