Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6430] array.array falsely advertises support for 'w' in documentation

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 6, 2009, 1:40 PM

Post #1 of 4 (201 views)
Permalink
[issue6430] array.array falsely advertises support for 'w' in documentation

New submission from Alexandre Vassalotti <alexandre [at] peadrop>:

It looks like either array's 'w' support got lost in a merge, or the
documentation is just wrong.


>>> import array
>>> array.array('w', "hello")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, f or d)
>>> print(array.__doc__)
This module defines an object type which can efficiently represent
an array of basic values: characters, integers, floating point
numbers. Arrays are sequence types and behave very much like lists,
except that the type of objects stored in them is constrained. The
type is specified at object creation time by using a type code, which
is a single character. The following type codes are defined:

Type code C Type Minimum size in bytes
'b' signed integer 1
'B' unsigned integer 1
'u' Unicode character 2 (see note)
'h' signed integer 2
'H' unsigned integer 2
'i' signed integer 2
'I' unsigned integer 2
'w' unicode character 4
'l' signed integer 4
'L' unsigned integer 4
'f' floating point 4
'd' floating point 8

NOTE: The 'u' typecode corresponds to Python's unicode character. On
narrow builds this is 2-bytes on wide builds this is 4-bytes.

----------
assignee: georg.brandl
components: Documentation, Extension Modules
messages: 90190
nosy: alexandre.vassalotti, georg.brandl
priority: low
severity: normal
status: open
title: array.array falsely advertises support for 'w' in documentation
versions: Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6430>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 7, 2009, 1:10 AM

Post #2 of 4 (175 views)
Permalink
[issue6430] array.array falsely advertises support for 'w' in documentation [In reply to]

Ezio Melotti <ezio.melotti [at] gmail> added the comment:

Apparently 'w' and 'u' were used for wide and narrow builds
respectively. In r58441 the distinction was removed and now 'u' can be
either 2 or 4 bytes, depending on the build.
I think that 'w' can be removed.

----------
nosy: +ezio.melotti

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6430>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 7, 2009, 1:35 AM

Post #3 of 4 (175 views)
Permalink
[issue6430] array.array falsely advertises support for 'w' in documentation [In reply to]

Ezio Melotti <ezio.melotti [at] gmail> added the comment:

The problem seems to affect Python 2 too. See also #1268.
In the online doc 'w' is not mentioned but a note about the size of 'u'
that changes depending on the build should be added too.
Also in the table in the Python 2 doc [1] the "Python Type" for
'unsigned int' and 'signed long' seem swapped [2].

[1]: http://docs.python.org/library/array.html
[2]: Modules/arraymodule.c under "/* Description of types */"

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6430>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 11, 2009, 3:39 AM

Post #4 of 4 (166 views)
Permalink
[issue6430] array.array falsely advertises support for 'w' in documentation [In reply to]

Georg Brandl <georg [at] python> added the comment:

OK, fixed this in r73940, r73941, r73942.

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6430>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.