summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2014-06-07 13:21:14 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2014-06-07 13:21:14 (GMT)
commit1462786f008671fb4ae85f8b9c7a4e54777ff13a (patch)
treeda8f7c57d3f32017a4281f24eeb1e884ab891143 /Doc
parent4a3f135c8d623d97782ccaea6bb37b1786f86de0 (diff)
downloadcpython-1462786f008671fb4ae85f8b9c7a4e54777ff13a.zip
cpython-1462786f008671fb4ae85f8b9c7a4e54777ff13a.tar.gz
cpython-1462786f008671fb4ae85f8b9c7a4e54777ff13a.tar.bz2
Issue #21667: Clarify string data model description
Diffstat (limited to 'Doc')
-rw-r--r--Doc/reference/datamodel.rst19
1 files changed, 10 insertions, 9 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index a901891..d401ee0 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -285,16 +285,17 @@ Sequences
single: integer
single: Unicode
- A string is a sequence of values that represent Unicode codepoints.
- All the codepoints in range ``U+0000 - U+10FFFF`` can be represented
- in a string. Python doesn't have a :c:type:`chr` type, and
- every character in the string is represented as a string object
- with length ``1``. The built-in function :func:`ord` converts a
- character to its codepoint (as an integer); :func:`chr` converts
- an integer in range ``0 - 10FFFF`` to the corresponding character.
+ A string is a sequence of values that represent Unicode code points.
+ All the code points in the range ``U+0000 - U+10FFFF`` can be
+ represented in a string. Python doesn't have a :c:type:`char` type;
+ instead, every code point in the string is represented as a string
+ object with length ``1``. The built-in function :func:`ord`
+ converts a code point from its string form to an integer in the
+ range ``0 - 10FFFF``; :func:`chr` converts an integer in the range
+ ``0 - 10FFFF`` to the corresponding length ``1`` string object.
:meth:`str.encode` can be used to convert a :class:`str` to
- :class:`bytes` using the given encoding, and :meth:`bytes.decode` can
- be used to achieve the opposite.
+ :class:`bytes` using the given text encoding, and
+ :meth:`bytes.decode` can be used to achieve the opposite.
Tuples
.. index::