A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-June/111880.html below:

[Python-Dev] Python 3.x and bytes

[Python-Dev] Python 3.x and bytes [Python-Dev] Python 3.x and bytesEthan Furman 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'[0] and possibly hiding this in a constant
> definition.

Using this method, my code now looks like:

# constants

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.

~Ethan~
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4