This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pfalcon
Recipients pfalcon
Date 2014-04-08.13:32:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
With bytearray, you can do:

>>> bytearray(3)

However, with arrays:

>>> array.array('i', 3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable

Given that int passed as seconf argument is not handled specially in array, I'd like to propose to make it an initial size of a zero-filled array to create. This will make it: a) consitent with bytearray; b) efficient for the scenarios where one needs to pre-create array of given length, pass to some (native) function to fill in, then do rest of processing. For the latter case, assuming that both fill-in and further processing is efficient (e.g. done by native function), the initial array creation becomes a bottleneck.
Date User Action Args
2014-04-08 13:32:06pfalconsetrecipients: + pfalcon
2014-04-08 13:32:06pfalconsetmessageid: <>
2014-04-08 13:32:06pfalconlinkissue21180 messages
2014-04-08 13:32:05pfalconcreate