chore: update typing to be generic on function args

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner
2023-04-18 13:06:17 -04:00
parent 6d038dfbdf
commit 8c5f89c035
12 changed files with 48 additions and 39 deletions
+4 -1
View File
@@ -4,6 +4,7 @@ These are utilities for the `/bin` scripts, not for the `cibuildwheel` program.
from __future__ import annotations
from collections.abc import Mapping, Sequence
from io import StringIO
from .typing import Protocol
@@ -16,7 +17,9 @@ class Printable(Protocol):
...
def dump_python_configurations(inp: dict[str, dict[str, list[dict[str, Printable]]]]) -> str:
def dump_python_configurations(
inp: Mapping[str, Mapping[str, Sequence[Mapping[str, Printable]]]]
) -> str:
output = StringIO()
for header, values in inp.items():
output.write(f"[{header}]\n")