the bytes type in python 2.7 and PEP-358

前端 未结 3 1823
囚心锁ツ
囚心锁ツ 2020-11-28 11:49

According to PEP 358, a bytes object is used to store a mutable sequence of bytes (0-255), raising if this is not the case.

However, my python 2.7 says otherwise

3条回答
  •  借酒劲吻你
    2020-11-28 12:31

    bytes objects only really exist in Python 3.x. bytes is an alias for str in Python 2.7. It exists to help writing portable code between Python 2 and 3.

提交回复
热议问题