Skip to content

Commit 5a7d7b7

Browse files
author
David Robertson
authored
Mark key types as SupportsBytes (#21)
1 parent 8cfb577 commit 5a7d7b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

signedjson/types.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515

1616
import sys
17-
from typing import TYPE_CHECKING
17+
from typing import TYPE_CHECKING, SupportsBytes
1818

1919
import nacl.signing
2020

@@ -24,7 +24,7 @@
2424
from typing import Protocol
2525

2626

27-
class BaseKey(Protocol):
27+
class BaseKey(Protocol, SupportsBytes):
2828
"""Common base type for VerifyKey and SigningKey"""
2929

3030
version = "" # type: str
@@ -56,5 +56,7 @@ def sign(self, message):
5656

5757
@property
5858
def verify_key(self):
59+
# Note: use `signedjson.key.get_verify_key` to get a
60+
# `signedjson.types.VerifyKey`.
5961
# type: () -> nacl.signing.VerifyKey
6062
pass # pragma: nocover

0 commit comments

Comments
 (0)