[issue29903] struct.Struct Addition

Serhiy Storchaka report at bugs.python.org
Sat Mar 25 12:45:26 EDT 2017


Serhiy Storchaka added the comment:

What is the purpose of this feature? Note that the layout of the structure consisting of two structures is not the same as the layout of the structure consisting of the same fields as separate structures.

struct {
    struct {
        char a;
        short b;
    } s1;
    struct {
        char c;
        int d;
    } s2;
}

and

struct {
    char a;
    short b;
    char c;
    int d;
}

can have different sizes and offsets of fields.

As for the concrete implementation, it looks to me that Struct('2L') + Struct('25B') results to Struct('2L5B').

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29903>
_______________________________________


More information about the Python-bugs-list mailing list