Meador Inge <[email protected]> added the comment:
> is that correct, or should the production list be something like:
Yup, you are right. I will change the grammar.
> Whether these cases are valid or not (personally, I think they should
> be), we should add some tests for them. '<' *is* currently valid, I
> believe.
I agree, they should be valid. I will add more test cases.
> The possibility of mixing native size/alignment with standard
> size/alignment in a single format string makes me a bit uneasy
I agree. It is hard for me to see how this might be used. In any case,
the relevant part of the PEP that I was following is:
"Endian-specification ('!', '@','=','>','<', '^') is also allowed inside the
string so that it can change if needed. The previously-specified endian string
is in force until changed. The default endian is '@' which means native
data-types and alignment. If un-aligned, native data-types are requested, then
the endian specification is '^'."
However, I am not quite sure how to interpret the last sentence.
> Should the switch to '>' within the embedded struct be regarded as
> local to the struct?
No, there is no notion of scope here. A given specifier is active until the
next one is found.
> Ah, it should have been:
>
> assert(soself->s_tree != NULL);
D'oh! I missed that when I merge over to py3k -- I started this work on trunk.
Thanks.
----------
Added file: http://bugs.python.org/file17416/struct-string.py3k.2.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue3132>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com