aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--paste/__init__.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/paste/__init__.py b/paste/__init__.py
index 9b052c6..31f86bc 100644
--- a/paste/__init__.py
+++ b/paste/__init__.py
@@ -1,7 +1,7 @@
from base64 import b64decode, b64encode
from functools import wraps
from wsgiref.util import request_uri
-from typing import Optional, Any
+from typing import Optional, Any, Protocol
from collections.abc import Callable, Iterable
import binascii
import traceback
@@ -10,7 +10,18 @@ from sqlite3 import Connection
from . import db
from . import store
-StartResponse = Callable[[str, list[tuple[str, str]]], Optional[tuple]]
+
+class StartResponse(Protocol):
+ def __call__(
+ self,
+ status: str,
+ headers: list[tuple[str, str]],
+ exc_info: Optional[tuple] = ...,
+ /,
+ ) -> Callable[[bytes], object]:
+ ...
+
+
Env = dict[str, Any]
App = Callable[[Env, StartResponse], Iterable[bytes]]
Response = Iterable[bytes]