diff options
author | Georg Brandl <georg@python.org> | 2008-12-06 08:12:11 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-12-06 08:12:11 (GMT) |
commit | d2aa7e66270708a580ad166fa02f7c0f05249084 (patch) | |
tree | 2ec17400631dcc4f7aa4ffc4899b95f7432d9158 | |
parent | 9af5235fa5cc6a92054ab9bd924d5040be1d0303 (diff) | |
download | cpython-d2aa7e66270708a580ad166fa02f7c0f05249084.zip cpython-d2aa7e66270708a580ad166fa02f7c0f05249084.tar.gz cpython-d2aa7e66270708a580ad166fa02f7c0f05249084.tar.bz2 |
#4557: remove 'c' typecode from array docs and add a note in whatsnew.
-rw-r--r-- | Doc/library/array.rst | 7 | ||||
-rw-r--r-- | Doc/whatsnew/3.0.rst | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Doc/library/array.rst b/Doc/library/array.rst index 08142e1..2fb4f8a 100644 --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -18,8 +18,6 @@ defined: +-----------+----------------+-------------------+-----------------------+ | 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 @@ The following data items and methods are also supported: 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]) diff --git a/Doc/whatsnew/3.0.rst b/Doc/whatsnew/3.0.rst index 3e4188f..68e8c5a 100644 --- a/Doc/whatsnew/3.0.rst +++ b/Doc/whatsnew/3.0.rst @@ -625,7 +625,9 @@ Some other changes to standard library modules, not covered by * 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`. |