Skip to content

Commit 10f052e

Browse files
authored
Fix str type annotations to bytes
I was type annotating another library and noticed this. I feel like the intention is to use `bytes` not `str` given things like the use of `chr()`
1 parent 213b05c commit 10f052e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_binascii.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ def _transform(n: int) -> str:
106106
assert len(TABLE_A2B_B64) == 256
107107

108108

109-
def a2b_base64(b64_data: str) -> bytes:
109+
def a2b_base64(b64_data: bytes) -> bytes:
110110
"""Convert a block of base64 data back to binary and return the binary data.
111111
112-
:param str b64_data: Base64 data.
112+
:param bytes b64_data: Base64 data.
113113
114114
"""
115115
res = []
@@ -148,10 +148,10 @@ def a2b_base64(b64_data: str) -> bytes:
148148
return b"".join(res)
149149

150150

151-
def b2a_base64(bin_data: str) -> bytes:
151+
def b2a_base64(bin_data: bytes) -> bytes:
152152
"""Convert binary data to a line of ASCII characters in base64 coding.
153153
154-
:param str bin_data: Binary data string, as bytes
154+
:param bytes bin_data: Binary data string, as bytes
155155
156156
"""
157157
newlength = (len(bin_data) + 2) // 3

0 commit comments

Comments
 (0)