Skip to content

Commit

Permalink
use startswith
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jul 2, 2024
1 parent c99a69b commit 3cf8e5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def generate_class_stub(self, class_name: str, cls: type, output: list[str]) ->
prop_type_name = self.strip_or_import(annotations[attr])
static_properties.append(f"{self._indent}{attr}: {prop_type_name} = ...")

if "ClassVar[" in prop_type_name[: len("ClassVar[")]:
if prop_type_name.startswith("ClassVar["):
self.add_name("typing.ClassVar")
else:
prop_type_name = self.strip_or_import(self.get_type_annotation(value))
Expand Down

0 comments on commit 3cf8e5e

Please sign in to comment.