Roundup Robot added the comment:
New changeset 44dac2e7fcb8 by Benjamin Peterson in branch '2.7':
support pep 3118 format strings for ctypes objects with nontrivial shapes
(closes #10744)
http://hg.python.org/cpython/rev/44dac2e7fcb8
New changeset 22938bf57161 by Benjamin Peterson in branch
mattip added the comment:
Updated patch for default for empty shape, thanks eryksun
--
Added file:
http://bugs.python.org/file35224/hg-default-ctypes-fix-pep3118-format-strings-for-arrays-update.patch
___
Python tracker rep...@bugs.python.org
mattip added the comment:
Here are updated patches for 2.7 and HEAD.
I've updated the patches for both python 2 and python 3 and addressed some of
the issues here:
1. Added _ctypes_alloc_format_string_with_shape() to ctypes.h
2. Changed the buffer size calculation to 32 *ndim + 3 (for the
mattip added the comment:
Here is the patch for HEAD
--
Added file:
http://bugs.python.org/file35218/hg-default-ctypes-fix-pep3118-format-strings-for-arrays-update.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge
versions: +Python 3.5 -Python 2.7, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
Changes by Antoine Pitrou pit...@free.fr:
--
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
___
Python-bugs-list
eryksun added the comment:
The shape for the StructWithArrays test should be () in 3.x; it's None in 2.x.
--
nosy: +eryksun
versions: +Python 3.3 -Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
Changes by Tillmann Karras til...@gmail.com:
--
nosy: +Tilka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
___
Python-bugs-list mailing
Changes by STINNER Victor victor.stin...@gmail.com:
--
versions: +Python 3.4 -Python 3.1, Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
STINNER Victor added the comment:
@skrah: What is the status of this issue?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
___
Stefan Krah added the comment:
Basically someone has to review the patch and commit it. I'm not really
using ctypes, so for me a decent review would take a while.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
Ronald Oussoren added the comment:
The correct format string for Py_ssize_t with sprintf is
%PY_FORMAT_SIZE_Td (defined and explained in pyport.h).
--
nosy: +ronaldoussoren
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
Pauli Virtanen p...@iki.fi added the comment:
The array notation is useful for arrays inside structs, such as T{(4)i(2,3)f}.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
___
Stefan Krah stefan-use...@bytereef.org added the comment:
Thanks for the patch. I agree with the interpretation of the format string.
One thing is unclear though: Using this interpretation the multi-dimensional
array notation in format strings only seems useful for pointers to arrays.
The PEP
Changes by Stefan Krah stefan-use...@bytereef.org:
--
nosy: +skrah
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
___
Python-bugs-list
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
___
Changes by Georg Brandl ge...@python.org:
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10744
___
___
Python-bugs-list mailing
New submission from Pauli Virtanen p...@iki.fi:
Ctypes arrays have invalid buffer interface information (on Python 3.1.2):
import ctypes
x = (ctypes.c_double*2)()
y = memoryview(x)
y.shape
(2,)
y.format
'(2)d'
This implies that the array contains 2 items, each consisting of 2 floats,
19 matches
Mail list logo