[Python-Dev] Python 3.x and bytes

Hagen Fürstenau hagen at zhuliguan.net
Sun Jun 12 19:46:22 CEST 2011


> EOH  = b'\r'[0]
> CHAR = b'C'[0]
> DATE = b'D'[0]
> FLOAT = b'F'[0]
> INT = b'I'[0]
> LOGICAL = b'L'[0]
> MEMO = b'M'[0]
> NUMBER = b'N'[0]
> 
> This is not beautiful code.

You still have the alternative

EOH = ord('\r')
CHAR = ord('C')
...

which looks fine to me.

Cheers,
Hagen



More information about the Python-Dev mailing list