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: Reintroduce index checking in 1-element ctypes arrays
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: anthonybaxter, theller
Priority: normal Keywords: patch

Created on 2006-07-13 13:21 by theller, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ctypes.diff theller, 2006-07-13 13:21 Patch against current SVN trunk.
Messages (3)
msg50683 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2006-07-13 13:21
This patch removes the special casing of 1-sized arrays
in ctypes.  Currently, 1-sized arrays do *no* index
checking in indexing or slicing operations.  The idea
was to have 1-sized arrays operate as variable sized
data types.

It was a bad idea, as it turns out, since it breaks a
very common pattern: iterating over arrays.  All this
code would have to be special cased when the size of
the array is one.

According to a RFC on the ctypes-users list it seems
that nobody uses this feature, which is not astonishing
since it was only very recently added.
msg50684 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2006-07-14 03:45
Logged In: YES 
user_id=29957

Sounds fine to checkin now. Please make sure to add a NEWS item.
msg50685 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2006-07-14 18:06
Logged In: YES 
user_id=11105

Thanks.

Committed as revision 50643.
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43663
2006-07-13 13:21:20thellercreate