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~
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