Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f4d76e6c
Commit
f4d76e6c
authored
Oct 25, 2011
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#13251: update string description in datamodel.rst.
parent
f602c556
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Doc/reference/datamodel.rst
Doc/reference/datamodel.rst
+10
-10
No files found.
Doc/reference/datamodel.rst
View file @
f4d76e6c
...
@@ -276,16 +276,16 @@ Sequences
...
@@ -276,16 +276,16 @@ Sequences
single: integer
single: integer
single: Unicode
single: Unicode
The items of a string object are Unicode code units. A Unicode code
A string is a sequence of values that represent Unicode codepoints.
unit is represented by a string object of one item and can hold either
All the codepoints in range ``U+0000 - U+10FFFF`` can be represented
a 16-bit or 32-bit value representing a Unicode ordinal (the maximum
in a string. Python doesn't have a :c:type:`chr` type, and
value for the ordinal is given in ``sys.maxunicode``, and depends on
every characters in the string is represented as a string object
how Python is configured at compile time). Surrogate pairs may be
with length ``1``. The built-in function :func:`chr` converts a
present in the Unicode object, and will be reported as two separate
character to its codepoint (as an integer); :func:`ord` converts
items. The built-in functions :func:`chr` and :func:`ord` convert
an integer in range ``0 - 10FFFF`` to the corresponding character.
between code units and nonnegative integers representing the Unicode
:meth:`str.encode` can be used to convert a :class:`str` to
ordinals as defined in the Unicode Standard 3.0. Conversion from and to
:class:`bytes` using the given encoding, and :meth:`bytes.decode` can
other encodings are possible through the string method :meth:`encode`
.
be used to achieve the opposite
.
Tuples
Tuples
.. index::
.. index::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment