]> granicus.if.org Git - python/commitdiff
#6430: add note about size of "u" type.
authorGeorg Brandl <georg@python.org>
Sat, 11 Jul 2009 10:37:38 +0000 (10:37 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 11 Jul 2009 10:37:38 +0000 (10:37 +0000)
Doc/library/array.rst

index 3b247b7700b83a23e7807017d12d7417a2d4e34a..f48bf06d9baa28ad773646b35abdbe997057f407 100644 (file)
@@ -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