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 skrah
Recipients Arfrever, georg.brandl, mark.dickinson, meador.inge, ncoghlan, pitrou, python-dev, skrah, vstinner
Date 2012-08-07.11:55:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344340531.12.0.758557763037.issue15573@psf.upfronthosting.co.za>
In-reply-to
Content
Continuing the discussion from #13072. I hit a snag here:

Determining in full generality whether two format strings describe
identical items is pretty complicated, see also #3132.


I'm attaching a best effort fmtcmp() function that should do the
following:

  - recognize byte order specifiers at the start of the string.

  - recognize if an explicitly specified byte order happens to
    match the native byte order.

It won't catch:

  - byte order specifiers anywhere in the string.

  - C types that happen to be identical ('I', 'L' on a 32-bit
    platform). I'm also not sure if that is desirable in the
    first place.

  - ???


So fmtcmp() will return false negatives (not equal), but should be
correct for *most* format strings that are actually in use.


Mark, Meador: You did a lot of work on the struct module and of
course on issue #3132. Does this look like a reasonable compromise?
Did I miss obvious cases (see attachment)?
History
Date User Action Args
2012-08-07 11:55:31skrahsetrecipients: + skrah, georg.brandl, mark.dickinson, ncoghlan, pitrou, vstinner, Arfrever, meador.inge, python-dev
2012-08-07 11:55:31skrahsetmessageid: <1344340531.12.0.758557763037.issue15573@psf.upfronthosting.co.za>
2012-08-07 11:55:30skrahlinkissue15573 messages
2012-08-07 11:55:28skrahcreate