
May 24, 2011
4:40 a.m.
Bruce Leban writes:
I recognize that the compiler can optimize:
if bytesdata[i] == b'x'[0]:
but that looks like chicken scratches to me.
Using named constants should fix that, and is better style anyway.
Someone suggested using 0'x' which I don't quite get. It looks too much like 0x to me
True but minor, IMO YMMV.
and the I've always read the leading zero to mean 'this is a number'.
That's precisely Nick's point in suggesting it!