New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module struct support for ssize_t and size_t #47413
Comments
Attached is a (simplistic) patch for the struct module to support C types The patch updates Python 2.6b1 files Modules/_struct.c and Note, format character 'Z' is also proposed in PEP-3118 for C type complex |
Now that Python 2.6 is in beta, new features should be deferred to 2.7. |
Please ignore the first patch. Use the rev2 patch which includes an |
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. |
To avoid clashing with PEP-3118, we could use 'n' and 'N' instead of 'z' and 'Z'. |
Jean, if you're still around: Do you still have interest in pursuing this? |
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:
|
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. |
Okay; would you be interested in updating your patch? |
bpo-3163 is a duplicate. |
Ooops, I meant bpo-13098. |
Here is a patch. |
Mostly LGTM. I have a few comments in rietveld. |
Thanks. I have answered one of your comments, and here is a new patch. |
New patch with cosmetic doc fix. |
Found a few test case nits. Comments in rietveld. |
Thanks for the comments. Here is an updated patch. |
No problem. This last version LGTM. |
New changeset db3e15017172 by Antoine Pitrou in branch 'default': |
Thanks for the reviews! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: