Python 3
Since Python 3.0, the Python language reference specifies:
A bytes object is an immutable array. The items are 8-bit bytes, represented by integers in the range 0 <= x < 256.
Python 2
Before that (i.e., up to Python 2.7), it specified (as already mentioned in the question):
The items of a string are characters. […] Characters represent (at least) 8-bit bytes.
(Emphasis added.)
Note that Python 2 did not have a bytes
object. To hold immutable sequences of byte-chunked binary data in Python 2, strings were/are usually used. (Python 3 strings in contrast are meant for textual data only and are more equivalent to Python 2's unicode
objects than to Python 2 strings.)
but ...
Python 2 documentation of the ord()
function mentions "8-bit strings" and contrasts them to unicode objects. It might be implied that all non-unicode Python-2 strings are 8-bit strings, but I wouldn't count on that.
Conclusion
A Python implementation that provides Python-3-compliant bytes
objects would be restricted to only hold 8-bit bytes in them. A Python implementation compliant to Python 2 would not be bound by this (as a bytes
object, if it features one, would be unspecified) and if you'd use its Python-2-compliant strings as a substitute, there wouldn't be any guarantees about maximum byte size (actually, character size), either, unless the implementation states some guarantees of its own.