[issue2909] struct.Struct.unpack to return a namedtuple for easier attribute access

Aaron Gallagher report at bugs.python.org
Sun May 18 23:41:15 CEST 2008


Aaron Gallagher <habnabit at gmail.com> added the comment:

Okay, here's a new version of my patch. Instead of replacing the default 
functionality of struct.Struct, this patch now adds the functionality to a 
separate class called NamedStruct, so as to not break backwards 
compatibility. The coding style has been revised, and it now also raises a 
more descriptive error if the regex fails to parse. Also included: a unit 
test.

----------
versions: +Python 2.6
Added file: http://bugs.python.org/file10374/named-struct2.patch

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2909>
__________________________________


More information about the Python-bugs-list mailing list