Closed
Description
Mypy recently introduced stricter checks for function signature compatibility (python/mypy#2521). Since itsdangerous
is included in the typeshed library with typing stubs, it found an issue with the signatures of load_payload
. Consider:
class Serializer:
def load_payload(self, payload, serializer=None): ...
vs.
class JSONWebSignatureSerializer(Serializer):
def load_payload(self, payload, return_header=False): ...
vs.
class URLSafeSerializerMixin(object):
def load_payload(self, payload): ...
class URLSafeSerializer(URLSafeSerializerMixin, Serializer): ...
class TimedSerializer(Serializer): ...
class URLSafeTimedSerializer(URLSafeSerializerMixin, TimedSerializer): ...
Basically, it's invalid to replace load_payload()
accepting an optional kwarg with an implementation that doesn't.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Temporary workaround for pallets/itsdangerous#74
davidism commentedon Dec 23, 2016
PyCharm has complained about it for a while too. If you have a fix in mind, a patch would be great, otherwise I'll investigate.
Make `load_payload()` signature consistent between types
load_payload()
signature consistent between types #75ambv commentedon Dec 23, 2016
Alright, PR ready.
Make `load_payload()` signature consistent between types (#75)
Update py-itsdangerous to 1.1.0.