Title: ctypes pointer arithmetic
Type: enhancement Stage: needs patch
Components: ctypes Versions: Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: theller Nosy List: Rosuav, amaury.forgeotdarc, berker.peksag, mark.dickinson, martin.panter, theller
Priority: normal Keywords: patch

Created on 2009-06-10 19:37 by theller, last changed 2015-10-11 08:44 by Rosuav.

File name Uploaded Description Edit
ctypes-pointerarith.patch theller, 2009-06-10 19:37 Patch for python trunk review
Messages (5)
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*:
  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.
msg252771 - (view) Author: Chris Angelico (Rosuav) * Date: 2015-10-11 06:41
Nudging this as a forgotten patch. Is anyone at all interested in this, or should it be closed as not worth the hassle? The patch is ancient and doesn't apply to 3.6.

Propose closing, to clean up the tracker. It can always be reopened if the patch is updated to current.
msg252780 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-10-11 08:41
Thanks for triaging work, but an outdated patch is not an enough reason to close an issue. Also, the default value of "status" field is "open" at so closing an unresolved issue will make it harder to find for potential interested contributors. See for more information.
msg252782 - (view) Author: Chris Angelico (Rosuav) * Date: 2015-10-11 08:44
Fair enough. Still needs someone to update the patch though.
Date User Action Args
2015-10-11 08:44:32Rosuavsetmessages: + msg252782
2015-10-11 08:41:09berker.peksagsetversions: + Python 3.6, - Python 2.7, Python 3.2
nosy: + berker.peksag

messages: + msg252780

stage: needs patch
2015-10-11 06:41:52Rosuavsetnosy: + Rosuav
messages: + msg252771
2014-08-01 04:51:49martin.pantersetnosy: + martin.panter
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