Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (just
the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361,
r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new
documentation. The only significant difference is that round(x) returns a float
to preserve backward-compatibility. See http://bugs.python.org/issue1689.
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index b45044d..6fc1f8e 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -150,7 +150,7 @@
indicate the presence of the ``...`` syntax in a slice. Its truth value is
true.
-Numbers
+:class:`numbers.Number`
.. index:: object: numeric
These are created by numeric literals and returned as results by arithmetic
@@ -162,7 +162,7 @@
Python distinguishes between integers, floating point numbers, and complex
numbers:
- Integers
+ :class:`numbers.Integral`
.. index:: object: integer
These represent elements from the mathematical set of integers (positive and
@@ -214,7 +214,7 @@
without causing overflow, will yield the same result in the long integer domain
or when using mixed operands.
- Floating point numbers
+ :class:`numbers.Real` (:class:`float`)
.. index::
object: floating point
pair: floating point; number
@@ -229,7 +229,7 @@
overhead of using objects in Python, so there is no reason to complicate the
language with two kinds of floating point numbers.
- Complex numbers
+ :class:`numbers.Complex`
.. index::
object: complex
pair: complex; number
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index ea2bb1a..9c416f8 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -801,7 +801,8 @@
raised).
Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`.
-Raising a negative number to a fractional power results in a :exc:`ValueError`.
+Raising a negative number to a fractional power results in a :class:`complex`
+number. (Since Python 2.6. In earlier versions it raised a :exc:`ValueError`.)
.. _unary: