summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2020-12-17 09:27:52 -0800
committerGitHub <noreply@github.com>2020-12-17 23:27:52 +0600
commite3a1ba52b5926bd419a5bab73c64d7bce1089958 (patch)
tree8049892b8d36372202ef61a921345ad438864190
parentdb4d2f09a1e5ba0b9fdab49d9e51006c60de2b63 (diff)
downloadpyjwt-e3a1ba52b5926bd419a5bab73c64d7bce1089958.tar.gz
Enforce .encode() return type using mypy (#551)
Closes #505
-rw-r--r--jwt/api_jws.py2
-rw-r--r--jwt/api_jwt.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/jwt/api_jws.py b/jwt/api_jws.py
index f01f53e..bce7a1a 100644
--- a/jwt/api_jws.py
+++ b/jwt/api_jws.py
@@ -79,7 +79,7 @@ class PyJWS:
algorithm: str = "HS256",
headers: Optional[Dict] = None,
json_encoder: Optional[Type[json.JSONEncoder]] = None,
- ):
+ ) -> str:
segments = []
if algorithm is None:
diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py
index d5bcb15..60f319b 100644
--- a/jwt/api_jwt.py
+++ b/jwt/api_jwt.py
@@ -40,7 +40,7 @@ class PyJWT(PyJWS):
algorithm: str = "HS256",
headers: Optional[Dict] = None,
json_encoder: Optional[Type[json.JSONEncoder]] = None,
- ):
+ ) -> str:
# Check that we get a mapping
if not isinstance(payload, Mapping):
raise TypeError(