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 palaviv
Recipients mark.dickinson, meador.inge, palaviv, rhettinger, serhiy.storchaka
Date 2017-03-25.18:12:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490465531.88.0.154222076443.issue29903@psf.upfronthosting.co.za>
In-reply-to
Content
I have two use cases for this feature:
1.

struct a {
    int a;
#ifdef VER2
    unsigned int b;
#endif
}

Now I may do:
>>> ver1 = Struct("i")
>>> ver2 = ver1 + Struct("I")

2.

struct a {
    int a;
    union inner {
        int b;
        unsigned int c;
    } u;
}

As you can see with this feature I may do:
>>> start = Struct("i")
>>> union_b = Struct("i")
>>> union_c = Struct("I")
>>> version_a = start + union_b
>>> version_b = start + union_c

If you have a big struct with many options in the union this save's copying the initial format.

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

I will fix the case when there is no format provided.
History
Date User Action Args
2017-03-25 18:12:11palavivsetrecipients: + palaviv, rhettinger, mark.dickinson, meador.inge, serhiy.storchaka
2017-03-25 18:12:11palavivsetmessageid: <1490465531.88.0.154222076443.issue29903@psf.upfronthosting.co.za>
2017-03-25 18:12:11palavivlinkissue29903 messages
2017-03-25 18:12:11palavivcreate