Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve the error message for invalid typecodes inmultiprocessing.{Array,Value} #133017

Closed
Assignees
tomasr8
Labels
stdlibStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-featureA feature request or enhancement
@tomasr8

Description

@tomasr8

Feature or enhancement

Proposal:

More discussion:#132504 (comment)

This is the current message which is not very clear (it comes fromctypes.sizeof):

>>>frommultiprocessingimportArray>>>Array('x',1)...TypeError:this typehasnosize

I propose we change it to:

>>>frommultiprocessingimportArray>>>Array('x',1)TypeError:badtypecode (mustbeactypestypeoroneofc,b,B,u,h,H,i,I,l,L,q,Q,ford)

This is modeled after the error message inarray.array which is more informative:

>>>array('x')...ValueError:badtypecode (mustbeb,B,u,w,h,H,i,I,l,L,q,Q,ford)

(AValueError seems like a more appropriate option for multiprocessing as well, but that'd be a breaking change)
Note that,multiprocessing.Array (andValue) does not support the 'w' typecode whilearray.array does.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

#132504 (comment)

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp