summaryrefslogtreecommitdiff
path: root/Doc/reference
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-05 21:42:51 +0000
committerGeorg Brandl <georg@python.org>2008-05-05 21:42:51 +0000
commite06de8b3cc279804f7f38a8002ca171094f83f55 (patch)
treee9b58dae5efa86f0c50fd0bdb68ce6354b670ceb /Doc/reference
parent7694100e4b44a6dd965964af323e5e0c23ffc897 (diff)
downloadcpython-git-e06de8b3cc279804f7f38a8002ca171094f83f55.tar.gz
#2762: remove 2.x remnants and patch up some new documentation.
Diffstat (limited to 'Doc/reference')
-rw-r--r--Doc/reference/compound_stmts.rst11
-rw-r--r--Doc/reference/datamodel.rst4
-rw-r--r--Doc/reference/lexical_analysis.rst17
-rw-r--r--Doc/reference/simple_stmts.rst16
4 files changed, 16 insertions, 32 deletions
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index c81c75faba..ed770cb002 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -334,12 +334,6 @@ Additional information on exceptions can be found in section :ref:`exceptions`,
and information on using the :keyword:`raise` statement to generate exceptions
may be found in section :ref:`raise`.
-.. seealso::
-
- :pep:`3110` - Catching exceptions in Python 3000
- Describes the differences in :keyword:`try` statements between Python 2.x
- and 3.0.
-
.. _with:
.. _as:
@@ -390,11 +384,6 @@ The execution of the :keyword:`with` statement proceeds as follows:
value from :meth:`__exit__` is ignored, and execution proceeds at the normal
location for the kind of exit that was taken.
-
- In Python 2.5, the :keyword:`with` statement is only allowed when the
- ``with_statement`` feature has been enabled. It is always enabled in
- Python 2.6.
-
.. seealso::
:pep:`0343` - The "with" statement
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index f7d52833a3..74b2efbe12 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -510,10 +510,6 @@ Callable types
An instance method object combines a class, a class instance and any
callable object (normally a user-defined function).
- .. versionchanged:: 2.6
- For 3.0 forward-compatibility, :attr:`im_func` is also available as
- :attr:`__func__`, and :attr:`im_self` as :attr:`__self__`.
-
.. index::
single: __func__ (method attribute)
single: __self__ (method attribute)
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 2a9fd7931c..5748b9e2f7 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -270,16 +270,20 @@ Identifiers and keywords
.. index:: identifier, name
Identifiers (also referred to as *names*) are described by the following lexical
-definitions:
+definitions.
The syntax of identifiers in Python is based on the Unicode standard annex
-UAX-31, with elaboration and changes as defined below.
+UAX-31, with elaboration and changes as defined below; see also :pep:`3131` for
+further details.
Within the ASCII range (U+0001..U+007F), the valid characters for identifiers
-are the same as in Python 2.5; Python 3.0 introduces additional
-characters from outside the ASCII range (see :pep:`3131`). For other
-characters, the classification uses the version of the Unicode Character
-Database as included in the :mod:`unicodedata` module.
+are the same as in Python 2.x: the uppercase and lowercase letters ``A`` through
+``Z``, the underscore ``_`` and, except for the first character, the digits
+``0`` through ``9``.
+
+Python 3.0 introduces additional characters from outside the ASCII range (see
+:pep:`3131`). For these characters, the classification uses the version of the
+Unicode Character Database as included in the :mod:`unicodedata` module.
Identifiers are unlimited in length. Case is significant.
@@ -308,7 +312,6 @@ A non-normative HTML file listing all valid identifier characters for Unicode
4.1 can be found at
http://www.dcl.hpi.uni-potsdam.de/home/loewis/table-3131.html.
-See :pep:`3131` for further details.
.. _keywords:
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index a9d534e381..0b90703dad 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -480,7 +480,7 @@ The :keyword:`raise` statement
pair: raising; exception
.. productionlist::
- raise_stmt: "raise" [`expression` ["," `expression` ["," `expression`]]]
+ raise_stmt: "raise" [`expression` ["from" `expression`]]
If no expressions are present, :keyword:`raise` re-raises the last exception
that was active in the current scope. If no exception is active in the current
@@ -498,24 +498,20 @@ The :dfn:`type` of the exception is the exception instance's class, the
.. index:: object: traceback
A traceback object is normally created automatically when an exception is raised
-and attached to it as the :attr:`__traceback__` attribute; however, you can set
-your own traceback using the :meth:`with_traceback` exception method, like so::
+and attached to it as the :attr:`__traceback__` attribute, which is writable.
+You can create an exception and set your own traceback in one step using the
+:meth:`with_traceback` exception method (which returns the same exception
+instance, with its traceback set to its argument), like so::
raise RuntimeError("foo occurred").with_traceback(tracebackobj)
-.. XXX document exception chaining
+.. XXX document exception chaining
The "from" clause is used for exception chaining, which is not documented yet.
Additional information on exceptions can be found in section :ref:`exceptions`,
and information about handling exceptions is in section :ref:`try`.
-.. seealso::
-
- :pep:`3109` - Raising exceptions in Python 3000
- Describes the differences in :keyword:`raise` statements between Python
- 2.x and 3.0.
-
.. _break: