This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author meetaig
Recipients meetaig
Date 2017-10-24.12:13:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1508847217.79.0.213398074469.issue31859@psf.upfronthosting.co.za>
In-reply-to
Content
In the initialization of a new `RawArray` the `size_or_initializer` parameter is tested for being an instance of `int`. When passing something like numpy.int64 here, the code crashes, because it does not recognize this as an integer. The workaround is to cast to int(). Wouldn't it be nicer to compare to types.IntType to allow for custom integer types?

def RawArray(typecode_or_type, size_or_initializer):
    '''
    Returns a ctypes array allocated from shared memory
    '''
    type_ = typecode_to_type.get(typecode_or_type, typecode_or_type)
-    if isinstance(size_or_initializer, int):
+    if size_or_initializer is IntType:
History
Date User Action Args
2017-10-24 12:13:37meetaigsetrecipients: + meetaig
2017-10-24 12:13:37meetaigsetmessageid: <1508847217.79.0.213398074469.issue31859@psf.upfronthosting.co.za>
2017-10-24 12:13:37meetaiglinkissue31859 messages
2017-10-24 12:13:37meetaigcreate