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.

classification
Title: ctypes should allow a tuple when an Array is expected
Type: enhancement Stage:
Components: Extension Modules Versions: Python 2.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: theller Nosy List: theller
Priority: normal Keywords: patch

Created on 2008-01-11 19:17 by theller, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ctypes-array-3.patch theller, 2008-01-14 21:42 ctypes-array-3.patch
Messages (4)
msg59738 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2008-01-11 19:17
Another ctypes patch for discussion, if someone cares.

This patch allows to pass a tuple of the correct size, a ctypes pointer
to the correct itemtype, or None to foreign functions that expect ctypes
array instances.  'None' is passed as a NULL pointer.

Currently, only array instances are accepted.
msg59921 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2008-01-14 21:35
Lenard Lindstrom pointed out in a post to the ctypes-users list that
pointer instances must not be accepted.  Uploaded new patch
ctypes-array-2.patch.
msg59923 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2008-01-14 21:42
Corrected the patch to NOT accept None.
msg60002 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2008-01-16 20:06
Lenard Lindstrom convinced me that tuples should not be allowed when an
array is expected.
History
Date User Action Args
2022-04-11 14:56:29adminsetgithub: 46129
2008-01-16 20:06:22thellersetstatus: open -> closed
resolution: rejected
messages: + msg60002
2008-01-14 21:42:41thellersetfiles: + ctypes-array-3.patch
messages: + msg59923
2008-01-14 21:41:54thellersetfiles: - ctypes-array-2.patch
2008-01-14 21:36:29thellersetfiles: - ctypes-arrays.patch
2008-01-14 21:36:23thellersetfiles: + ctypes-array-2.patch
2008-01-14 21:35:36thellersetmessages: + msg59921
2008-01-11 19:17:06thellercreate