summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-07-11 10:37:38 (GMT)
committerGeorg Brandl <georg@python.org>2009-07-11 10:37:38 (GMT)
commit7750505d2d969676f74a5a189d30e9a41d77c503 (patch)
tree28b199d5a73422bfed12404006d7738ed680d923 /Doc
parent7c150bf904220c9280f4cc4d6c2d58128a48324b (diff)
downloadcpython-7750505d2d969676f74a5a189d30e9a41d77c503.zip
cpython-7750505d2d969676f74a5a189d30e9a41d77c503.tar.gz
cpython-7750505d2d969676f74a5a189d30e9a41d77c503.tar.bz2
#6430: add note about size of "u" type.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/array.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
index 3b247b7..f48bf06 100644
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -24,7 +24,7 @@ defined:
+-----------+----------------+-------------------+-----------------------+
| ``'B'`` | unsigned char | int | 1 |
+-----------+----------------+-------------------+-----------------------+
-| ``'u'`` | Py_UNICODE | Unicode character | 2 |
+| ``'u'`` | Py_UNICODE | Unicode character | 2 (see note) |
+-----------+----------------+-------------------+-----------------------+
| ``'h'`` | signed short | int | 2 |
+-----------+----------------+-------------------+-----------------------+
@@ -43,6 +43,11 @@ defined:
| ``'d'`` | double | float | 8 |
+-----------+----------------+-------------------+-----------------------+
+.. note::
+
+ The ``'u'`` typecode corresponds to Python's unicode character. On narrow
+ Unicode builds this is 2-bytes, on wide builds this is 4-bytes.
+
The actual representation of values is determined by the machine architecture
(strictly speaking, by the C implementation). The actual size can be accessed
through the :attr:`itemsize` attribute. The values stored for ``'L'`` and