summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2021-02-24 10:01:52 -0800
committerDavid Lord <davidism@gmail.com>2021-02-24 10:01:52 -0800
commitd9b95143dc84c762b50ac7b3723c74483e40ca7a (patch)
tree4d53833482183586831afebad0ab91540dbfdea2 /src
parentb39f96ebe965bc9b2f1326ec4ebb03353f5fd384 (diff)
downloaditsdangerous-d9b95143dc84c762b50ac7b3723c74483e40ca7a.tar.gz
consistent typing config
Diffstat (limited to 'src')
-rw-r--r--src/itsdangerous/timed.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/itsdangerous/timed.py b/src/itsdangerous/timed.py
index 2e254e9..5ea957f 100644
--- a/src/itsdangerous/timed.py
+++ b/src/itsdangerous/timed.py
@@ -19,6 +19,9 @@ _t_str_bytes = _t.Union[str, bytes]
_t_opt_str_bytes = _t.Optional[_t_str_bytes]
_t_opt_int = _t.Optional[int]
+if _t.TYPE_CHECKING:
+ import typing_extensions as _te
+
class TimestampSigner(Signer):
"""Works like the regular :class:`.Signer` but also records the time
@@ -59,7 +62,7 @@ class TimestampSigner(Signer):
self,
signed_value: _t_str_bytes,
max_age: _t_opt_int = None,
- return_timestamp: "_t.Literal[False]" = False,
+ return_timestamp: "_te.Literal[False]" = False,
) -> bytes:
...
@@ -68,7 +71,7 @@ class TimestampSigner(Signer):
self,
signed_value: _t_str_bytes,
max_age: _t_opt_int = None,
- return_timestamp: "_t.Literal[True]" = True,
+ return_timestamp: "_te.Literal[True]" = True,
) -> _t.Tuple[bytes, datetime]:
...