classification
Title: ctypes pointer arithmetic
Type: enhancement Stage:
Components: ctypes Versions: Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: theller Nosy List: amaury.forgeotdarc, mark.dickinson, theller
Priority: normal Keywords: patch

Created on 2009-06-10 19:37 by theller, last changed 2012-02-14 04:39 by meador.inge.

Files
File name Uploaded Description Edit
ctypes-pointerarith.patch theller, 2009-06-10 19:37 Patch for python trunk review
Messages (2)
msg89225 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2009-06-10 19:37
This patch implements some pointer arithmetic operations for ctypes.
msg89251 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-06-11 12:51
I like this feature. Some comments:

- tests...

- unsupported operand types should return Py_NotImplemented.

- gcc supports pointer arithmetic with void*:
  http://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html
  Could ctypes do the same?

- Some operations are not allowed. If p1 and p2 are ctypes pointers,
  "p1 -= p2" will not work - but it's not a common usage.
  However, "p1 + 1" and "p1 - 1" seem very useful, and should be supported.
History
Date User Action Args
2012-02-14 04:39:50meador.ingesettype: behavior -> enhancement
2009-06-11 12:51:54amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg89251
2009-06-10 19:50:10mark.dickinsonsetnosy: + mark.dickinson
2009-06-10 19:39:59thellersetassignee: theller
components: + ctypes
versions: + Python 3.2
2009-06-10 19:37:59thellercreate