[Python-3000-checkins] r64617 - python/branches/py3k/Doc/library/stdtypes.rst

mark.summerfield python-3000-checkins at python.org
Tue Jul 1 17:50:05 CEST 2008


Author: mark.summerfield
Date: Tue Jul  1 17:50:04 2008
New Revision: 64617

Log:
- No more 0L or similar.
- Added cross-refs to fraction & decimal in numeric types.
- Moved str.isdecimal() & str.isnumeric() into alphabetical order like
  all the other str methods; also massaged the text a bit to make it
  more consistent with the similar methods' texts.

BTW The iterator.__iter__() docs seems to be out of step with
functions.rst (where it now has an extra parameter).



Modified:
   python/branches/py3k/Doc/library/stdtypes.rst

Modified: python/branches/py3k/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k/Doc/library/stdtypes.rst	(original)
+++ python/branches/py3k/Doc/library/stdtypes.rst	Tue Jul  1 17:50:04 2008
@@ -46,7 +46,7 @@
 
 * ``False``
 
-* zero of any numeric type, for example, ``0``, ``0L``, ``0.0``, ``0j``.
+* zero of any numeric type, for example, ``0``, ``0.0``, ``0j``.
 
 * any empty sequence, for example, ``''``, ``()``, ``[]``.
 
@@ -216,15 +216,17 @@
    object: complex number
    pair: C; language
 
-There are three distinct numeric types: :dfn:`integers`, :dfn:`floating point
-numbers`, and :dfn:`complex numbers`.  In addition, Booleans are a subtype of
-integers.  Integers have unlimited precision.  Floating point numbers are
-implemented using :ctype:`double` in C.  All bets on their precision are off
-unless you happen to know the machine you are working with.
-
-Complex numbers have a real and imaginary part, which are each implemented using
-:ctype:`double` in C.  To extract these parts from a complex number *z*, use
-``z.real`` and ``z.imag``.
+There are three distinct numeric types: :dfn:`integers`, :dfn:`floating
+point numbers`, and :dfn:`complex numbers`.  In addition, Booleans are a
+subtype of integers.  Integers have unlimited precision.  Floating point
+numbers are implemented using :ctype:`double` in C---all bets on their
+precision are off unless you happen to know the machine you are working
+with. Complex numbers have a real and imaginary part, which are each
+implemented using :ctype:`double` in C.  To extract these parts from a
+complex number *z*, use ``z.real`` and ``z.imag``. (The standard library
+includes additional numeric types, :mod:`fractions` that hold rationals,
+and :mod:`decimal` that hold floating-point numbers with user-definable
+precision.)
 
 .. index::
    pair: numeric; literals
@@ -356,6 +358,9 @@
 | ``math.ceil(x)``   | the least Integral >= *x*      |        |
 +--------------------+--------------------------------+--------+
 
+For additional numeric operations see the :mod:`math` and :mod:`cmath`
+modules.
+
 .. XXXJH exceptions: overflow (when? what operations?) zerodivision
 
 
@@ -756,6 +761,15 @@
    one character, false otherwise.
 
 
+.. method:: str.isdecimal()
+
+   Return true if all characters in the string are decimal
+   characters and there is at least one character, false
+   otherwise. Decimal characters include digit characters, and all characters
+   that that can be used to form decimal-radix numbers, e.g. U+0660,
+   ARABIC-INDIC DIGIT ZERO.
+   
+
 .. method:: str.isdigit()
 
    Return true if all characters in the string are digits and there is at least one
@@ -774,6 +788,15 @@
    least one cased character, false otherwise.
 
 
+.. method:: str.isnumeric()
+
+   Return true if all characters in the string are numeric
+   characters, and there is at least one character, false
+   otherwise. Numeric characters include digit characters, and all characters
+   that have the Unicode numeric value property, e.g. U+2155,
+   VULGAR FRACTION ONE FIFTH.
+
+   
 .. method:: str.isprintable()
 
    Return true if all characters in the string are printable or the string is
@@ -1017,22 +1040,6 @@
    returned if *width* is less than ``len(s)``.
 
 
-.. method:: str.isnumeric()
-
-   Return ``True`` if there are only numeric characters in S, ``False``
-   otherwise. Numeric characters include digit characters, and all characters
-   that have the Unicode numeric value property, e.g. U+2155,
-   VULGAR FRACTION ONE FIFTH.
-
-   
-.. method:: str.isdecimal()
-
-   Return ``True`` if there are only decimal characters in S, ``False``
-   otherwise. Decimal characters include digit characters, and all characters
-   that that can be used to form decimal-radix numbers, e.g. U+0660,
-   ARABIC-INDIC DIGIT ZERO.
-   
-
 
 .. _old-string-formatting:
 


More information about the Python-3000-checkins mailing list