[issue15573] Support unknown formats in memoryview comparisons

Stefan Krah report at bugs.python.org
Wed Aug 8 13:32:00 CEST 2012


Stefan Krah added the comment:

Right, byte order specifiers are always at the beginning of the string.
That is at least something. I wonder if we should tighten PEP-3118 to
demand a canonical form of format strings, such as (probably incomplete):

  - Whitespace is disallowed.

  - Except for 's', no zero count may be given.

  - A count of 1 (redundant) is disallowed.

  - Repeats must be specified in terms of count + single char.


That still leaves the '=I' != '=L' problem. Why are there two
specifiers describing uint32_t?


Anyway, as Meador says, this can get tricky and I don't think this
can be resolved before beta-2. I'm attaching a patch that should
behave well for the restricted canonical form at least.

----------
keywords: +patch
Added file: http://bugs.python.org/file26725/issue15573.diff

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


More information about the Python-bugs-list mailing list