[Python-Dev] Python 3.x and bytes
ethan at stoneleaf.us
Sun Jun 12 19:18:24 CEST 2011
Guido van Rossum wrote:
> On Thu, May 19, 2011 at 1:43 AM, Nick Coghlan wrote:
>> Proposals to address this include:
>> - introduce a "character" literal to allow c'a' as an alternative to ord('a')
> -1; the result is not a *character* but an integer. I'm personally
> favoring using b'a' and possibly hiding this in a constant
Using this method, my code now looks like:
EOH = b'\r'
CHAR = b'C'
DATE = b'D'
FLOAT = b'F'
INT = b'I'
LOGICAL = b'L'
MEMO = b'M'
NUMBER = b'N'
This is not beautiful code.
More information about the Python-Dev