At 03:11 PM 6/13/2011 -0700, Ethan Furman wrote:
Nick Coghlan wrote:
> Agreed, but:
>
> EOH, CHAR, DATE, FLOAT, INT, LOGICAL, MEMO, NUMBER = b'\rCDFILMN'
>
> is a shorter way to write the same thing.
>
> Going two per line makes it easier to mentally map the characters:
>
> EOH, CHAR = b'\rC'
> DATE, FLOAT = b'DF'
> INT, LOGICAL = b'IL'
> MEMO, NUMBER = b'MN'
Wow. I didn't realize that could be done. That very nearly makes
up for not being able to do it one char at a time.
You can still do it one at a time:
CHAR, = b'C'
INT, = b'I'
...
etc. I just tried it with Python 3.1 and it works there.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com