This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gamaanderson
Recipients gamaanderson
Date 2015-04-13.14:25:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428935151.96.0.568768704224.issue23933@psf.upfronthosting.co.za>
In-reply-to
Content
Correct me if I'm wrong, the struct module does not work with array of ints, floats etc (just work with char in the form of strings). I think it should since this are valid elements in C structs. 

More specifically, consider I have this C struct

struct{
 int array[4];
};

I'm forced to do something like this:
  struct.pack('iiii', v1,v2,v3,v4)  #'4i' is just the same as 'iiii'

I would like to do something like this:
  struct.pack('i[4]', [v1,v2,v3,v4])

Of course this is useful if I want to pack with zeros:
  struct.pack('i[4]', [0]*4)
History
Date User Action Args
2015-04-13 14:25:52gamaandersonsetrecipients: + gamaanderson
2015-04-13 14:25:51gamaandersonsetmessageid: <1428935151.96.0.568768704224.issue23933@psf.upfronthosting.co.za>
2015-04-13 14:25:51gamaandersonlinkissue23933 messages
2015-04-13 14:25:51gamaandersoncreate