add doctest to _reverseBytes (not detected due to _memoize)
This commit is contained in:
parent
642352f0f5
commit
0e691fb432
@ -271,6 +271,12 @@ def _memoize(f):
|
||||
# opposite of what makes sense algorithmically and hence this function.
|
||||
@_memoize
|
||||
def _reverseBytes(data):
|
||||
r"""
|
||||
>>> bin(ord(_reverseBytes(0b00100111)))
|
||||
'0b11100100'
|
||||
>>> _reverseBytes(b'\x00\xf0')
|
||||
b'\x00\x0f'
|
||||
"""
|
||||
if isinstance(data, bytes) and len(data) != 1:
|
||||
return bytesjoin(map(_reverseBytes, data))
|
||||
byte = byteord(data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user