Skip to content

Commit

Permalink
Don't use implicit optionals (#705)
Browse files Browse the repository at this point in the history
* Turn off implicit-optional

* Change type annotations to use explicit optional

According to PEP 484, implicit Optional is no longer recommended.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
rekyungmin and pre-commit-ci[bot] authored Oct 22, 2021
1 parent 98de462 commit 31a8701
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions jwt/api_jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def decode_complete(
self,
jwt: str,
key: str = "",
algorithms: List[str] = None,
options: Dict = None,
algorithms: Optional[List[str]] = None,
options: Optional[Dict] = None,
**kwargs,
) -> Dict[str, Any]:
if options is None:
Expand Down Expand Up @@ -161,8 +161,8 @@ def decode(
self,
jwt: str,
key: str = "",
algorithms: List[str] = None,
options: Dict = None,
algorithms: Optional[List[str]] = None,
options: Optional[Dict] = None,
**kwargs,
) -> str:
decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs)
Expand Down
8 changes: 4 additions & 4 deletions jwt/api_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def decode_complete(
self,
jwt: str,
key: str = "",
algorithms: List[str] = None,
options: Dict = None,
algorithms: Optional[List[str]] = None,
options: Optional[Dict] = None,
**kwargs,
) -> Dict[str, Any]:
if options is None:
Expand Down Expand Up @@ -112,8 +112,8 @@ def decode(
self,
jwt: str,
key: str = "",
algorithms: List[str] = None,
options: Dict = None,
algorithms: Optional[List[str]] = None,
options: Optional[Dict] = None,
**kwargs,
) -> Dict[str, Any]:
decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ extend-ignore = E203, E501
python_version = 3.6
ignore_missing_imports = true
warn_unused_ignores = true
no_implicit_optional = true

0 comments on commit 31a8701

Please sign in to comment.