]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104050: Argument clinic: Annotate `str_converter_key()` (#107294)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Wed, 26 Jul 2023 20:12:18 +0000 (21:12 +0100)
committerGitHub <noreply@github.com>
Wed, 26 Jul 2023 20:12:18 +0000 (21:12 +0100)
Tools/clinic/clinic.py

index 2d804c96f86c3c94700f1b1bfb67803b61120f5e..34cc4014b35b43eb8042e5b905b39af6cf421c79 100755 (executable)
@@ -3624,10 +3624,14 @@ class buffer: pass
 class rwbuffer: pass
 class robuffer: pass
 
-def str_converter_key(types, encoding, zeroes):
+StrConverterKeyType = tuple[frozenset[type], bool, bool]
+
+def str_converter_key(
+    types: TypeSet, encoding: bool | str | None, zeroes: bool
+) -> StrConverterKeyType:
     return (frozenset(types), bool(encoding), bool(zeroes))
 
-str_converter_argument_map: dict[str, str] = {}
+str_converter_argument_map: dict[StrConverterKeyType, str] = {}
 
 class str_converter(CConverter):
     type = 'const char *'