mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Increase compatibility of itsdangerous URLSafeSerializerMixin & Serializer (#712)
I'm preparing a PR to mypy that further formalizes and improves the rules for which functions are "compatible" with each other, both for subtyping and for assignment. This is the one place in the stubs that violates the new rules but not the old: the supertype `Serializer` can take an optional positional argument called `serializer` to `load_payload`, but until this diff the mixin used to implement it could not, but rather could only take `serializer` as a named argument, through its **kwargs.
This commit is contained in:
committed by
Jukka Lehtosalo
parent
ed4f9e9b0b
commit
38d356503d
2
third_party/3/itsdangerous.pyi
vendored
2
third_party/3/itsdangerous.pyi
vendored
@@ -146,7 +146,7 @@ class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
|
||||
def now(self) -> int: ...
|
||||
|
||||
class URLSafeSerializerMixin:
|
||||
def load_payload(self, payload: Any, **kwargs) -> Any: ...
|
||||
def load_payload(self, payload: Any, serializer: Any = ..., **kwargs) -> Any: ...
|
||||
def dump_payload(self, *args, **kwargs) -> bytes: ...
|
||||
|
||||
class URLSafeSerializer(URLSafeSerializerMixin, Serializer):
|
||||
|
||||
Reference in New Issue
Block a user