Skip to content

Commit 61b12a2

Browse files
author
David Robertson
committed
Expose __bytes__ on Key protocols
My first attempt (inheriting from `SupportsBytes`) was fine as far as mypy was concerned. But this failed with an MRO problem. I suspect you're not supposed to actually inherit from `SupportsBytes`. Or maybe `SupportsBytes` is itself a `Protocol` and there was some inheritance ambiguity there.
1 parent 4d1adc6 commit 61b12a2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

signedjson/types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class BaseKey(Protocol):
3030
version = "" # type: str
3131
alg = "" # type: str
3232

33+
def __bytes__(self) -> bytes:
34+
pass
35+
3336
def encode(self):
3437
# type: () -> bytes
3538
pass # pragma: nocover

0 commit comments

Comments
 (0)