Bugs item #1533481, was opened at 2006-08-03 00:11 Message generated for change (Comment added) made by theller You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1533481&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Python 2.5 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Shane Holloway (shane_holloway) Assigned to: Nobody/Anonymous (nobody) Summary: CTypes _as_parameter_ not working as documented Initial Comment: Reference: http://docs.python.org/dev/lib/ctypes-calling-functions- with-own-custom-data-types.html According to this document, I should be able to use my own objects with ctypes, provided I have an _as_parameter_ attribute set on my object. However, this does not work properly when the foreign function's argtypes have been set. This is because the _as_parameter_ access is not done until after the argument types are checked. Attached is a patch that adds _as_parameter_ checking to the types provided by _ctypes.c so that the feature works as documented for both typed and untyped foreign functions. (Patch is against: svn rev 50859) ---------------------------------------------------------------------- >Comment By: Thomas Heller (theller) Date: 2006-08-14 16:21 Message: Logged In: YES user_id=11105 The patch in http://python.org/sf/1532975 was committed together with the general idea of this patch as SVN revision 51277. ---------------------------------------------------------------------- Comment By: Shane Holloway (shane_holloway) Date: 2006-08-03 00:13 Message: Logged In: YES user_id=283742 A related patch is http://python.org/sf/1532975 that simplifies the implementation of _as_parameter_ ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1533481&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com