Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard type codes for array.array, same as struct #53312

Open
cmcqueen1975 mannequin opened this issue Jun 24, 2010 · 4 comments
Open

Standard type codes for array.array, same as struct #53312

cmcqueen1975 mannequin opened this issue Jun 24, 2010 · 4 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@cmcqueen1975
Copy link
Mannequin

cmcqueen1975 mannequin commented Jun 24, 2010

BPO 9066
Nosy @pfalcon, @mdickinson, @serhiy-storchaka, @MojoVampire

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2010-06-24.04:58:28.910>
labels = ['type-feature', 'library']
title = 'Standard type codes for array.array, same as struct'
updated_at = <Date 2014-04-13.09:07:38.733>
user = 'https://bugs.python.org/cmcqueen1975'

bugs.python.org fields:

activity = <Date 2014-04-13.09:07:38.733>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2010-06-24.04:58:28.910>
creator = 'cmcqueen1975'
dependencies = []
files = []
hgrepos = []
issue_num = 9066
keywords = []
message_count = 4.0
messages = ['108501', '108510', '215758', '215760']
nosy_count = 5.0
nosy_names = ['pfalcon', 'mark.dickinson', 'cmcqueen1975', 'serhiy.storchaka', 'josh.r']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue9066'
versions = ['Python 3.5']

@cmcqueen1975
Copy link
Mannequin Author

cmcqueen1975 mannequin commented Jun 24, 2010

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

@cmcqueen1975 cmcqueen1975 mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jun 24, 2010
@mdickinson
Copy link
Member

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.

@pfalcon
Copy link
Mannequin

pfalcon mannequin commented Apr 8, 2014

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.

@pfalcon
Copy link
Mannequin

pfalcon mannequin commented Apr 8, 2014

See also http://bugs.python.org/issue17345

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant