summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-10-12 01:57:48 (GMT)
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-10-12 01:57:48 (GMT)
commitc33899bd713d2194c75802a543d0b350cb3bb276 (patch)
tree149ca8c50eee6329c4f901c6ba941f3e6f4e1ca2 /Doc
parent8958cd0e8d38c9a65231e1c23bc20b1f90a665d4 (diff)
downloadcpython-c33899bd713d2194c75802a543d0b350cb3bb276.zip
cpython-c33899bd713d2194c75802a543d0b350cb3bb276.tar.gz
cpython-c33899bd713d2194c75802a543d0b350cb3bb276.tar.bz2
Add and adjust some string-related links in the docs.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functions.rst11
-rw-r--r--Doc/library/stdtypes.rst8
2 files changed, 9 insertions, 10 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index e969194..d6a8d0c 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1206,7 +1206,8 @@ are always available. They are listed here in alphabetical order.
.. function:: str(object='')
str(object[, encoding[, errors]])
- Return a string version of an object, using one of the following modes:
+ Return a :ref:`string <textseq>` version of an object, using one of the
+ following modes:
If *encoding* and/or *errors* are given, :func:`str` will decode the
*object* which can either be a byte string or a character buffer using
@@ -1229,11 +1230,9 @@ are always available. They are listed here in alphabetical order.
Objects can specify what ``str(object)`` returns by defining a :meth:`__str__`
special method.
- For more information on strings see :ref:`typesseq` which describes sequence
- functionality (strings are sequences), and also the string-specific methods
- described in the :ref:`string-methods` section. To output formatted strings,
- see the :ref:`string-formatting` section. In addition see the
- :ref:`stringservices` section.
+ For more information on strings and string methods, see the :ref:`textseq`
+ section. To output formatted strings, see the :ref:`string-formatting`
+ section. In addition, see the :ref:`stringservices` section.
.. function:: sum(iterable[, start])
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index ed5b3ae..759206b 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1357,8 +1357,8 @@ Text Sequence Type --- :class:`str`
object: io.StringIO
-Textual data in Python is handled with :class:`str` objects, which are
-immutable sequences of Unicode code points. String literals are
+Textual data in Python is handled with ``str`` objects, which are immutable
+:ref:`sequences <typesseq>` of Unicode code points. String literals are
written in a variety of ways:
* Single quotes: ``'allows embedded "double" quotes'``
@@ -1376,8 +1376,8 @@ See :ref:`strings` for more about the various forms of string literal,
including supported escape sequences, and the ``r`` ("raw") prefix that
disables most escape sequence processing.
-Strings may also be created from other objects with the :ref:`str <func-str>`
-built-in.
+Strings may also be created from other objects with the built-in
+function :func:`str`.
Since there is no separate "character" type, indexing a string produces
strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``.