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 habnabit
Recipients habnabit
Date 2008-05-18.20:13:16
SpamBayes Score 0.20088287
Marked as misclassified No
Message-id <1211141600.93.0.483393592548.issue2909@psf.upfronthosting.co.za>
In-reply-to
Content
With the advent of collections.namedtuple, I thought that having a 
counterpart in the struct module would make having to deal with unpacked 
data much easier. Per suggestion, this extends the behavior of 
_struct.Struct rather than a separate NamedStruct class.

The regexp might not be immediately obvious as to what the format 
required is. The format string is represented like this: 
"attribute_name1(attribute_format) attribute_name2(attribute_format2)" 
and so on. Formats given in parentheses without an attribute name are 
allowed, so that byte order and pad bytes can be specified. For example: 
"(!) x1(h) x2(h) (2x) y1(h) y2(h)"

Suggestions and criticism are welcome. I think it would simplify using 
the struct module a lot to be able to have named attributes like this.
History
Date User Action Args
2008-05-18 20:13:21habnabitsetspambayes_score: 0.200883 -> 0.20088287
recipients: + habnabit
2008-05-18 20:13:20habnabitsetspambayes_score: 0.200883 -> 0.200883
messageid: <1211141600.93.0.483393592548.issue2909@psf.upfronthosting.co.za>
2008-05-18 20:13:19habnabitlinkissue2909 messages
2008-05-18 20:13:18habnabitcreate