Skip to content

Commit 0773fb7

Browse files
committed
Fix some type annotations
Code is only run by maintainer
1 parent 00655be commit 0773fb7

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

apsw/tests/async_meta.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import json
1818

1919
import queue
20-
from typing import Literal
20+
from typing import Literal, Callable, Any
2121

2222
import apsw
2323
import apsw.aio
@@ -31,8 +31,8 @@
3131
#
3232
# for attributes dual means awaitable get and worker thread set
3333
def get_meta(
34-
klass: str, member: str, kind: Literal["function" | "attribute"]
35-
) -> Literal["sync" | "async" | "dual" | "value"]:
34+
klass: str, member: str, kind: Literal["function"] | Literal["attribute"]
35+
) -> Literal["sync"] | Literal["async"] | Literal["dual"] | Literal["value"]:
3636
assert kind in {"function", "attribute"}
3737

3838
data = json.loads(importlib.resources.files("apsw.tests").joinpath("async_meta.json").read_text(encoding="utf8"))

tools/code2rst.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import json
1313
import pathlib
1414

15+
from typing import Literal
16+
1517
from apsw.tests.async_meta import get_meta as async_category
1618
from apsw.tests.async_meta import ASYNCABLE
1719

@@ -248,7 +250,7 @@ def do_methods():
248250
op.extend(fixup(op, saop))
249251

250252

251-
def async_markup(klass: str, member: str, kind: Literal["function" | "attribute"], doclines: list[str]):
253+
def async_markup(klass: str, member: str, kind: Literal["function"] | Literal["attribute"], doclines: list[str]):
252254
"returned revised body lines marked up with async behaviour"
253255

254256
# some we aren't going to markup

0 commit comments

Comments
 (0)