Marko Rauhamaa wrote: > The practical issue is how you refer to ASCII bytes. What I've resorted > to is: > > if nxt == b":"[0]: > ...
You seem to have the compiler's blessing: >>> def f(c): ... return c == b":"[0] ... >>> import dis >>> dis.dis(f) 2 0 LOAD_FAST 0 (c) 3 LOAD_CONST 3 (58) 6 COMPARE_OP 2 (==) 9 RETURN_VALUE > What's your favorite way of expressing character constants? Before I've seen your way I would have written COLON = ord(":") ... if nxt == COLON: ... -- https://mail.python.org/mailman/listinfo/python-list