[Patches] [ python-Patches-1521817 ] Reintroduce index checking in 1-element ctypes arrays

SourceForge.net noreply at sourceforge.net
Thu Jul 13 15:21:21 CEST 2006


Patches item #1521817, was opened at 2006-07-13 15:21
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1521817&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: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
Assigned to: Nobody/Anonymous (nobody)
Summary: Reintroduce index checking in 1-element ctypes arrays

Initial Comment:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1521817&group_id=5470


More information about the Patches mailing list