What is internal representation of string in Python 3.x

后端 未结 8 1031
逝去的感伤
逝去的感伤 2020-12-03 13:43

In Python 3.x, a string consists of items of Unicode ordinal. (See the quotation from the language reference below.) What is the internal representation of Unicode string? I

相关标签:
8条回答
  • 2020-12-03 14:11

    I think, Its hard to judge difference between UTF-16, which is just a sequences of 16 bit words, to Python's string object.

    And If python is compiled with Unicode=UCS4 option, it will be comparing between UTF-32 and Python string.

    So, better consider, they are in different category, although you can transform each others.

    0 讨论(0)
  • 2020-12-03 14:15

    It depends: see here. This is still true for Python 3 as far as internal representation goes.

    0 讨论(0)
提交回复
热议问题