Skip to content

Commit

Permalink
update some type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerbinns committed Jan 3, 2025
1 parent d5839f3 commit 510629f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apsw/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ def format_query_table(
*,
colour: bool = False,
quote: bool = False,
string_sanitize: Union[Callable[[str], str], Union[Literal[0], Literal[1], Literal[2]]] = 0,
string_sanitize: Callable[[str], str] | Literal[0] | Literal[1] | Literal[2] = 0,
binary: Callable[[bytes], str] = lambda x: f"[ { len(x) } bytes ]",
null: str = "(null)",
truncate: int = 4096,
Expand Down Expand Up @@ -1489,7 +1489,7 @@ def _format_table(
rows: list[apsw.SQLiteValues],
colour: bool,
quote: bool,
string_sanitize: Union[Callable[[str], str], Union[Literal[0], Literal[1], Literal[2]]],
string_sanitize: Callable[[str], str] | Literal[0] | Literal[1] | Literal[2],
binary: Callable[[bytes], str],
null: str,
truncate: int,
Expand Down Expand Up @@ -1588,7 +1588,7 @@ def repl(s):
assert isinstance(val, str), f"expected str not { val!r}"

# cleanup lines
lines = []
lines: list[str] = []
for line in apsw.unicode.split_lines(val):
if apsw.unicode.text_width(line) < 0:
line = "".join((c if apsw.unicode.text_width(c) >= 0 else "?") for c in line)
Expand Down

0 comments on commit 510629f

Please sign in to comment.