Skip to content

Commit acc9125

Browse files
committed
Use correct type annotation for PyWJK.from_json(algorithm=…) arg
This fixes a wrong type annotation for PyWJK.from_json(). The docs correctly say the ‘algorithm’ argument can be ‘str | None’, so annotate the function as such. The function then delegates to PyWJK.from_json() which already correctly accepts ‘str | None’.
1 parent 7144e45 commit acc9125

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

jwt/api_jwk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def from_dict(obj: JWKDict, algorithm: str | None = None) -> PyJWK:
9494
return PyJWK(obj, algorithm)
9595

9696
@staticmethod
97-
def from_json(data: str, algorithm: None = None) -> PyJWK:
97+
def from_json(data: str, algorithm: str | None = None) -> PyJWK:
9898
"""Create a :class:`PyJWK` object from a JSON string.
9999
Implicitly calls :meth:`PyJWK.from_dict()`.
100100

0 commit comments

Comments
 (0)