Issue 1796: ctypes should allow a tuple when an Array is expected (original) (raw)

Issue1796

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.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/46129

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:29 admin set github: 46129
2008-01-16 20:06:22 theller set status: open -> closedresolution: rejectedmessages: +
2008-01-14 21:42:41 theller set files: + ctypes-array-3.patchmessages: +
2008-01-14 21:41:54 theller set files: - ctypes-array-2.patch
2008-01-14 21:36:29 theller set files: - ctypes-arrays.patch
2008-01-14 21:36:23 theller set files: + ctypes-array-2.patch
2008-01-14 21:35:36 theller set messages: +
2008-01-11 19:17:06 theller create