Share

ctypes

Tracker: Feature Requests

5 Creating a restype supporting type - ID: 2714686
Last Update: Comment added ( theller )

Hi,

Adding support for classes to be sent as an argument using the argtypes
attribute and from_param(...) method seems pretty straight forward. Can a
similar extension be done to support the restype attribute, or will the
errcheck attribute be needed to do this conversion on the result?

More specifically I'd like to convert from ctypes arrays to NumPy arrays on
the fly when calling a DLL function.

Thanks,

Jens


Jens Rantil ( ztyx ) - 2009-03-26 15:14

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )

Date: 2009-03-26 20:55
Sender: thellerProject Admin

Since ctypes is now distributed as part of Python, such a request must go
into the Python tracker at bugs.python.org.

However, the 'callable as restype' protocol is broken because it only
works when the foreing function returns an integer; it will not work for
functions returning pointers when sizeof(int) != sizeof(void *)'. A new
protocol must be developed for this to work in full generality.


Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.