Christian Heimes added the comment:
That's the correct behaviour. Iteration and item access of bytes don't return
bytes but a small number, e.g. b[0] returns 116 and not b't'.
>>> b = b't'
>>> b[0] in [b]
False
>>> b[0]
116
>>> ord(b)
116
But:
>>> b in [b]
True
--
nosy: +christian.he
New submission from Ivan Bykov:
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> b = b't'
>>> b[0] in [b]
False
>>> u = 't'
>>> u[0] in [u]
True
--
messages: 177817
n