[Python-checkins] r67605 - in python/branches/py3k/Doc: library/array.rst whatsnew/3.0.rst

georg.brandl python-checkins at python.org
Sat Dec 6 09:12:11 CET 2008


Author: georg.brandl
Date: Sat Dec  6 09:12:11 2008
New Revision: 67605

Log:
#4557: remove 'c' typecode from array docs and add a note in whatsnew.


Modified:
   python/branches/py3k/Doc/library/array.rst
   python/branches/py3k/Doc/whatsnew/3.0.rst

Modified: python/branches/py3k/Doc/library/array.rst
==============================================================================
--- python/branches/py3k/Doc/library/array.rst	(original)
+++ python/branches/py3k/Doc/library/array.rst	Sat Dec  6 09:12:11 2008
@@ -18,8 +18,6 @@
 +-----------+----------------+-------------------+-----------------------+
 | Type code | C Type         | Python Type       | Minimum size in bytes |
 +===========+================+===================+=======================+
-| ``'c'``   | char           | character         | 1                     |
-+-----------+----------------+-------------------+-----------------------+
 | ``'b'``   | signed char    | int               | 1                     |
 +-----------+----------------+-------------------+-----------------------+
 | ``'B'``   | unsigned char  | int               | 1                     |
@@ -219,15 +217,14 @@
 
 When an array object is printed or converted to a string, it is represented as
 ``array(typecode, initializer)``.  The *initializer* is omitted if the array is
-empty, otherwise it is a string if the *typecode* is ``'c'``, otherwise it is a
+empty, otherwise it is a string if the *typecode* is ``'u'``, otherwise it is a
 list of numbers.  The string is guaranteed to be able to be converted back to an
 array with the same type and value using :func:`eval`, so long as the
 :func:`array` function has been imported using ``from array import array``.
 Examples::
 
    array('l')
-   array('c', 'hello world')
-   array('u', u'hello \u2641')
+   array('u', 'hello \u2641')
    array('l', [1, 2, 3, 4, 5])
    array('d', [1.0, 2.0, 3.14])
 

Modified: python/branches/py3k/Doc/whatsnew/3.0.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/3.0.rst	(original)
+++ python/branches/py3k/Doc/whatsnew/3.0.rst	Sat Dec  6 09:12:11 2008
@@ -625,7 +625,9 @@
 
 * Cleanup of the :class:`array.array` type: the :meth:`read` and
   :meth:`write` methods are gone; use :meth:`fromfile` and
-  :meth:`tofile` instead.
+  :meth:`tofile` instead.  Also, the ``'c'`` typecode for array is
+  gone -- use either ``'b'`` for bytes or ``'u'`` for Unicode
+  characters.
 
 * Cleanup of the :mod:`operator` module: removed
   :func:`sequenceIncludes` and :func:`isCallable`.


More information about the Python-checkins mailing list