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.

classification
Title: Standard type codes for array.array, same as struct
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cmcqueen1975, josh.r, mark.dickinson, pfalcon, serhiy.storchaka
Priority: normal Keywords:

Created on 2010-06-24 04:58 by cmcqueen1975, last changed 2022-04-11 14:57 by admin.

Messages (4)
msg108501 - (view) Author: Craig McQueen (cmcqueen1975) Date: 2010-06-24 04:58
The type codes for array.array are platform-dependent.

The type codes are similar to those for the struct module. It would be helpful for array.array to adopt the struct module's "=" format specifier prefix, to specify "standard" sizes. E.g.

    array_object = array.array("=L")  # 4-byte elements on all platforms
msg108510 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-06-24 12:55
I agree that it might be useful to have some way of specifying fixed-width integers.  It's not clear to me that importing specifier prefixes from the struct module is the best way to go about this, though.
msg215758 - (view) Author: Paul Sokolovsky (pfalcon) * Date: 2014-04-08 13:35
> It's not clear to me that importing specifier prefixes from the struct module is the best way to go about this, though.

What are other alternatives then? Using struct's syntax has obvious benefit of being consistent and not confusing people any further.
msg215760 - (view) Author: Paul Sokolovsky (pfalcon) * Date: 2014-04-08 13:38
See also http://bugs.python.org/issue17345
History
Date User Action Args
2022-04-11 14:57:02adminsetgithub: 53312
2016-10-05 09:43:55berker.peksaglinkissue17345 superseder
2014-04-13 09:07:38serhiy.storchakasetnosy: + serhiy.storchaka

versions: + Python 3.5, - Python 3.2, Python 3.3
2014-04-08 21:21:16josh.rsetnosy: + josh.r
2014-04-08 13:38:09pfalconsetmessages: + msg215760
2014-04-08 13:35:15pfalconsetnosy: + pfalcon
messages: + msg215758
2010-06-24 12:55:15mark.dickinsonsetnosy: + mark.dickinson

messages: + msg108510
stage: needs patch
2010-06-24 04:58:29cmcqueen1975create