Skip to content

Instantly share code, notes, and snippets.

@tyochiai
Last active December 16, 2015 02:09
Show Gist options
  • Save tyochiai/5360285 to your computer and use it in GitHub Desktop.
Save tyochiai/5360285 to your computer and use it in GitHub Desktop.
doctest のバグ? (Python 3.3.1 (v3.3.1:d9893d13c628, Apr 6 2013, 20:25:12) [MSC v.1600 32 bit (Intel)] on win32)
def test(byte):
"""
byte is 0-255 integer.
>>> test(1)
1
>>> test(b"\x01"[0])
1
>>> test(128)
128
>>> test(b"\x80"[0])
128 # SyntaxError: bytes can only contain ASCII literal characters.
"""
return byte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment