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:
Naomi Seyfer
2016-12-01 03:48:56 -08:00
committed by Jukka Lehtosalo
parent ed4f9e9b0b
commit 38d356503d

View File

@@ -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):