In Python 2.x str
and bytes
are exactly the same thing.
In Python 3.x, bytes
is a separate class, str
is always unicode, and the unicode
type was removed from the language.
Consider these two examples from the interpreter:
# Python 2.x
>>> str