From 38d356503d19227728e47eaf7ae0167c9c3c2b54 Mon Sep 17 00:00:00 2001 From: Naomi Seyfer Date: Thu, 1 Dec 2016 03:48:56 -0800 Subject: [PATCH] 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. --- third_party/3/itsdangerous.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/3/itsdangerous.pyi b/third_party/3/itsdangerous.pyi index 067fbdd1c..81016f931 100644 --- a/third_party/3/itsdangerous.pyi +++ b/third_party/3/itsdangerous.pyi @@ -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):