Skip to content

gh-148675: Reuse typecodes for array.array() error message#149779

Open
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:array_errmsg
Open

gh-148675: Reuse typecodes for array.array() error message#149779
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:array_errmsg

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented May 13, 2026

array.array() error message now reuses array.typecodes, instead of maintaining an hardcoded list of valid type codes.

array.array() error message now reuses array.typecodes, instead of
maintaining an hardcoded list of valid type codes.
@vstinner
Copy link
Copy Markdown
Member Author

Example:

import array
array.array('v')

Output:

Traceback (most recent call last):
  File "/home/vstinner/python/main/x.py", line 2, in <module>
    array.array('v')
    ~~~~~~~~~~~^^^^^
ValueError: bad typecode (must be: b, B, u, w, h, H, i, I, l, L, q, Q, e, f, d, Zf, Zd)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants