diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2023-07-26 20:12:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 20:12:18 (GMT) |
commit | 5aa6964a5ca60dff5c5ab40b968d92b49bd13b3d (patch) | |
tree | 0d1e80a14e992970aaf08f5009beab9f1d025123 /Tools/clinic | |
parent | f9bcdf2368d25e6c56193c13d49de031ac2ae2e9 (diff) | |
download | cpython-5aa6964a5ca60dff5c5ab40b968d92b49bd13b3d.zip cpython-5aa6964a5ca60dff5c5ab40b968d92b49bd13b3d.tar.gz cpython-5aa6964a5ca60dff5c5ab40b968d92b49bd13b3d.tar.bz2 |
gh-104050: Argument clinic: Annotate `str_converter_key()` (#107294)
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-x | Tools/clinic/clinic.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 2d804c96..34cc401 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -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 *' |