Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 3d85696

Browse files
committed
Fix import for Python 3.10
1 parent 62f05e0 commit 3d85696

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/betterproto2_compiler/known_types/google_values.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
import typing
1+
from typing import TYPE_CHECKING
22

33
from betterproto2_compiler.lib.google.protobuf import (
44
BoolValue as VanillaBoolValue,
55
StringValue as VanillaStringValue,
66
)
77

8+
if TYPE_CHECKING:
9+
from typing import Self
10+
811

912
class BoolValue(VanillaBoolValue):
1013
@staticmethod
11-
def from_wrapped(wrapped: bool) -> typing.Self:
14+
def from_wrapped(wrapped: bool) -> "Self":
1215
return BoolValue(value=wrapped)
1316

1417
def to_wrapped(self) -> bool:
@@ -17,7 +20,7 @@ def to_wrapped(self) -> bool:
1720

1821
class StringValue(VanillaStringValue):
1922
@staticmethod
20-
def from_wrapped(wrapped: str) -> typing.Self:
23+
def from_wrapped(wrapped: str) -> "Self":
2124
return StringValue(value=wrapped)
2225

2326
def to_wrapped(self) -> str:

0 commit comments

Comments
 (0)