aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_web/__init__.py1
-rw-r--r--python/fatcat_web/types.py14
2 files changed, 15 insertions, 0 deletions
diff --git a/python/fatcat_web/__init__.py b/python/fatcat_web/__init__.py
index 4c08649e..0d3445ca 100644
--- a/python/fatcat_web/__init__.py
+++ b/python/fatcat_web/__init__.py
@@ -15,6 +15,7 @@ from flask_wtf.csrf import CSRFProtect
from loginpass import GitHub, Gitlab, ORCiD, create_flask_blueprint
from raven.contrib.flask import Sentry
+from fatcat_web.types import AnyResponse
from fatcat_web.web_config import Config
toolbar = DebugToolbarExtension()
diff --git a/python/fatcat_web/types.py b/python/fatcat_web/types.py
new file mode 100644
index 00000000..f5182d71
--- /dev/null
+++ b/python/fatcat_web/types.py
@@ -0,0 +1,14 @@
+from typing import Any, Tuple, Union
+
+from flask import Response as FlaskResponse
+from werkzeug.wrappers import Response as WerkzeugResponse
+
+# type to represent any of the used/plausible return types
+AnyResponse = Union[
+ FlaskResponse,
+ str,
+ Tuple[str, int],
+ WerkzeugResponse,
+ Tuple[FlaskResponse, int],
+ Tuple[WerkzeugResponse, int],
+]