Patches item #1532975, was opened at 2006-08-02 09:57 Message generated for change (Comment added) made by theller You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1532975&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: Accepted Priority: 5 Submitted By: Thomas Heller (theller) Assigned to: Thomas Heller (theller) Summary: Replace the ctypes internal '_as_parameter_' mechanism Initial Comment: This patch removes the '_as_parameter_' public attribute of ctypes instances, and replaces the mechanism by an internal one. This mechanism is used to convert a ctypes instance to an (internal) PyCArgObject instance which can directly by used as an argument in a C function call. With this patch, a C function pointer which does create the PyCArgObject instance is stored in the type dictionary (an StgDict instance). This does speed up foreign function calls with one ctypes argument by about 20%, but more important, it will allow to fix the '_as_parameter_' mechanism, which is documented in [1], so that it actually will work as describes, even for functions that have 'argtypes' set. [1] http://docs.python.org/dev/lib/ctypes-calling-functions-with-own-custom-data-types.html ---------------------------------------------------------------------- >Comment By: Thomas Heller (theller) Date: 2006-08-14 16:20 Message: Logged In: YES user_id=11105 A variant of this patch together with the general idea of the patch in #1533481 was committed as SVN rev. 51227. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2006-08-12 07:54 Message: Logged In: YES user_id=33168 Please check this in ASAP and remember to make an entry in Misc/NEWS. Also, PyObject_stgdict() can return NULL, but the values aren't checked. There may be a few other unchecked returns. ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2006-08-03 10:51 Message: Logged In: YES user_id=11105 The previous patch was against the ctypes repository. I've deleted this patch and attached a new one against the Python svn trunk. ---------------------------------------------------------------------- Comment By: Shane Holloway (shane_holloway) Date: 2006-08-03 00:15 Message: Logged In: YES user_id=283742 This patch enables bug fix for the _as_parameter_ mechanism. Please see http://python.org/sf/1533481. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1532975&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches