Skip to content

[array] Add w typecode and deprecate u typecode #14475

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

donBarbos
Copy link
Contributor

@donBarbos donBarbos commented Jul 27, 2025

@srittau
Copy link
Collaborator

srittau commented Jul 27, 2025

Considering this has been deprecated since 3.3 and since all these versions have the alternative available, I think should just apply the deprecation to all supported versions. (We can be looser in the stubs than the implementation, as the stubs will only affect developers that run a type checker on the code, while the runtime deprecation will also be shown to users.)

@Akuli
Copy link
Collaborator

Akuli commented Jul 27, 2025

all these versions have the alternative available

No, they don't:

Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import array
>>> array.array('w')
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, q, Q, f or d)

@srittau
Copy link
Collaborator

srittau commented Jul 27, 2025

Huh, it's unfortunate that the docs don't point that out ...

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Akuli
Copy link
Collaborator

Akuli commented Jul 28, 2025

I created python/cpython#137184 to fix the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy