Skip to content

Commit

Permalink
More bound classvar
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jul 2, 2024
1 parent 4fd475c commit c99a69b
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:
if "ClassVar[" in prop_type_name[: len("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 c99a69b

Please sign in to comment.