msg68528 - (view) |
Author: Jean Brouwers (MrJean1) |
Date: 2008-06-21 18:05 |
Attached is a (simplistic) patch for the struct module to support C types ssize_t and size_t with format characters 'z' resp. 'Z'. The patch updates Python 2.6b1 files Modules/_struct.c and Doc/library/struct.rst. Note, format character 'Z' is also proposed in PEP 3118 for C type complex and that has to be something else, perhaps 'C'. |
|
|
msg68530 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2008-06-21 18:17 |
Now that Python 2.6 is in beta, new features should be deferred to 2.7. |
|
|
msg68531 - (view) |
Author: Jean Brouwers (MrJean1) |
Date: 2008-06-21 18:26 |
Please ignore the first patch. Use the rev2 patch which includes an update for test file Lib/test/test_struct.py as well. |
|
|
msg107799 - (view) |
Author: Mark Dickinson (mark.dickinson) *  |
Date: 2010-06-14 16:55 |
The proposed addition seems reasonable to me, for native packing and unpacking. For standard mode packing and unpacking, I don't see the point; we'd have to pick a standard size, which would almost certainly be either 4 or 8, and so would already be covered by either the 'iI' or the 'qQ' codes. So I'd suggest adding the size_t/ssize_t codes only for native mode, and leaving them unsupported for the standard modes. |
|
|
msg107800 - (view) |
Author: Mark Dickinson (mark.dickinson) *  |
Date: 2010-06-14 16:55 |
To avoid clashing with PEP 3118, we could use 'n' and 'N' instead of 'z' and 'Z'. |
|
|
msg110313 - (view) |
Author: Mark Dickinson (mark.dickinson) *  |
Date: 2010-07-14 19:08 |
Jean, if you're still around: Do you still have interest in pursuing this? |
|
|
msg110330 - (view) |
Author: Jean Brouwers (MrJean1) |
Date: 2010-07-14 21:12 |
Yes I am and I will get back to you on this after check my (old) notes. /Jean On Wed, Jul 14, 2010 at 12:08 PM, Mark Dickinson <report@bugs.python.org>wrote: > > Mark Dickinson <dickinsm@gmail.com> added the comment: > > Jean, if you're still around: > > Do you still have interest in pursuing this? > > ---------- > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue3163> > _______________________________________ > |
|
|
msg110385 - (view) |
Author: Jean Brouwers (MrJean1) |
Date: 2010-07-15 18:29 |
It would be sufficient to support size_t/ssize_t in native mode for my usage. The workaround I have been using is in this recipe <http://code.activestate.com/recipes/546530/> in the function calcsize. That maps the 'z' and 'Z' format to either 'l', 'L' or 'P' for lack of anything better. |
|
|
msg112867 - (view) |
Author: Mark Dickinson (mark.dickinson) *  |
Date: 2010-08-04 19:12 |
Okay; would you be interested in updating your patch? |
|
|
msg144885 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-10-04 12:08 |
#3163 is a duplicate. |
|
|
msg144886 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-10-04 12:08 |
Ooops, I meant #13098. |
|
|
msg144888 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-10-04 12:41 |
Here is a patch. |
|
|
msg144891 - (view) |
Author: Meador Inge (meador.inge) *  |
Date: 2011-10-04 14:26 |
Mostly LGTM. I have a few comments in rietveld. |
|
|
msg144892 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-10-04 14:34 |
Thanks. I have answered one of your comments, and here is a new patch. |
|
|
msg144893 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-10-04 14:54 |
New patch with cosmetic doc fix. |
|
|
msg144936 - (view) |
Author: Meador Inge (meador.inge) *  |
Date: 2011-10-05 02:41 |
Found a few test case nits. Comments in rietveld. |
|
|
msg144950 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-10-05 13:46 |
Thanks for the comments. Here is an updated patch. |
|
|
msg144978 - (view) |
Author: Meador Inge (meador.inge) *  |
Date: 2011-10-06 00:28 |
No problem. This last version LGTM. |
|
|
msg145009 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2011-10-06 13:31 |
New changeset db3e15017172 by Antoine Pitrou in branch 'default': Issue #3163: The struct module gets new format characters 'n' and 'N' http://hg.python.org/cpython/rev/db3e15017172 |
|
|
msg145010 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2011-10-06 13:31 |
Thanks for the reviews! |
|
|