Skip to content

Commit fb65910

Browse files
committed
better naming and comment
1 parent f90010e commit fb65910

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/hpack/hpack.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ def _dict_to_iterable(header_dict):
143143
yield key, header_dict[key]
144144

145145

146-
def _to_bytes(string):
146+
def _to_bytes(value):
147147
"""
148-
Convert string to bytes.
148+
Convert anything to bytes through a UTF-8 encoded string
149149
"""
150-
t = type(string)
150+
t = type(value)
151151
if t is bytes:
152-
return string
152+
return value
153153
if t is not str:
154-
string = str(string)
155-
return string.encode("utf-8")
154+
value = str(value)
155+
return value.encode("utf-8")
156156

157157

158158
class Encoder:

0 commit comments

Comments
 (0)