Guido van Rossum wrote: > However there's quite a bit of Python 2.x code around that manipulates > *bytes* in the guise of 8-bit strings, and it uses tests like "if s[0] > == 'x': ..." frequently. This can of course be rewritten using a > slice, but not so easily when you're looping over bytes: > > for b in bb: > if b == b'x': ...
Would it make anything easier if there were a character literal? for b in bb: if b == c'x': ... where c'x' is another way of writing ord(b'x'). An advantage of this is that it would make Py3k compatible with Pyrex, which already has c'x' literals. :-) -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiem! | Christchurch, New Zealand | (I'm not a morning person.) | [EMAIL PROTECTED] +--------------------------------------+ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com