[issue11673] RawArray does not accept long

2011-03-25 Thread Robert Kern
New submission from Robert Kern : The constructor for multiprocessing.RawArray() takes an argument that is either an integer size or a sequence to initialize the contents. To determine if the argument is a size, it uses isinstance(x, int). This means that integers that happen to be Python long

[issue11673] RawArray does not accept long

2011-03-25 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the patch. Are there practical cases where the operator.index check is more useful that the isinstance(..., (int, long)) check that you originally proposed (off-tracker)? While I agree that it's the right fix in principle, the operator.index chec

[issue11673] RawArray does not accept long

2011-03-25 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson stage: -> commit review ___ Python tracker ___ ___ Python-bugs-list maili

[issue11673] RawArray does not accept long

2011-03-25 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +jnoller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue11673] RawArray does not accept long

2011-03-25 Thread Robert Kern
Robert Kern added the comment: The practical case I was thinking of was numpy integer scalar types, which can crop up without explicitly requesting them, much like the long type. Although, now that I check, I see that single-element numpy arrays also pass index(). Ideally, there would be two

[issue11673] RawArray does not accept long

2011-03-25 Thread Mark Dickinson
Mark Dickinson added the comment: > The practical case I was thinking of was numpy integer scalar types Hmm, true. But at least numpy.int instances pass an isinstance(..., int) check, right? But that still leaves numpy.int as a problem on 32-bit systems and Windows, and similarly for 64-bit

[issue11673] RawArray does not accept long

2011-03-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2d183b1dae5a by Mark Dickinson in branch '2.7': Issue #11673: Fix multiprocessing.[Raw]Array constructor to accept a size of type long. Thanks Robert Kern. http://hg.python.org/cpython/rev/2d183b1dae5a -- nosy: +python-dev __

[issue11673] RawArray does not accept long

2011-03-25 Thread Robert Kern
Robert Kern added the comment: numpy.int is just an alias to the builtin int, left for historical reasons. The integer scalar type that has the same width as Python's int (numpy.int32 or numpy.int64, depending) will always pass the isinstance() check. Since it's the default integer type in nu

[issue11673] RawArray does not accept long

2011-03-26 Thread Mark Dickinson
Changes by Mark Dickinson : -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___