From 120105b3f93b793a27fa61294e16f453dbdc16e5 Mon Sep 17 00:00:00 2001 From: Ian McDonald Date: Tue, 15 Oct 2024 10:20:21 -0700 Subject: [PATCH] Remove excess quotes on the 3.10 type generator Remove the excess quotes on the 3.10 type generator for better type usage. --- src/betterproto/plugin/typing_compiler.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/betterproto/plugin/typing_compiler.py b/src/betterproto/plugin/typing_compiler.py index eca3691f9..b105edf3b 100644 --- a/src/betterproto/plugin/typing_compiler.py +++ b/src/betterproto/plugin/typing_compiler.py @@ -146,28 +146,28 @@ def _fmt(type: str) -> str: # for now this is necessary till 3.14 return type def optional(self, type: str) -> str: - return f'"{self._fmt(type)} | None"' + return f'{self._fmt(type)} | None' def list(self, type: str) -> str: - return f'"list[{self._fmt(type)}]"' + return f'list[{self._fmt(type)}]' def dict(self, key: str, value: str) -> str: - return f'"dict[{key}, {self._fmt(value)}]"' + return f'dict[{key}, {self._fmt(value)}]' def union(self, *types: str) -> str: - return f'"{" | ".join(map(self._fmt, types))}"' + return f'{" | ".join(map(self._fmt, types))}' def iterable(self, type: str) -> str: self._imports["collections.abc"].add("Iterable") - return f'"Iterable[{type}]"' + return f'Iterable[{type}]' def async_iterable(self, type: str) -> str: self._imports["collections.abc"].add("AsyncIterable") - return f'"AsyncIterable[{type}]"' + return f'AsyncIterable[{type}]' def async_iterator(self, type: str) -> str: self._imports["collections.abc"].add("AsyncIterator") - return f'"AsyncIterator[{type}]"' + return f'AsyncIterator[{type}]' def imports(self) -> Dict[str, Optional[Set[str]]]: return {k: v if v else None for k, v in self._imports.items()}