Re: [Python-Dev] Python 3.x and bytes

At 01:56 AM 6/14/2011 +0000, exarkun@twistedmatrix.com wrote:
On 12:35 am, ncoghlan@gmail.com wrote:
On Tue, Jun 14, 2011 at 9:40 AM, P.J. Eby <pje@telecommunity.com> wrote:
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.
I almost mentioned that, although it does violate one of the "unwritten rules of the Zen" (in this case, "syntax shall not look like grit on Tim's monitor")
[CHAR] = b'C' [INT] = b'I' ...
Holy carpal tunnel time machine... That works in 2.3. (Without the 'b' of course.) Didn't know you could just use list syntax like that. It's an extra character to type, and two more shift keyings, but brevity isn't always the soul of clarity.

P.J. Eby wrote:
At 01:56 AM 6/14/2011 +0000, exarkun@twistedmatrix.com wrote:
On 12:35 am, ncoghlan@gmail.com wrote:
On Tue, Jun 14, 2011 at 9:40 AM, P.J. Eby <pje@telecommunity.com> wrote:
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.
I almost mentioned that, although it does violate one of the "unwritten rules of the Zen" (in this case, "syntax shall not look like grit on Tim's monitor")
[CHAR] = b'C' [INT] = b'I' ...
Holy carpal tunnel time machine... That works in 2.3. (Without the 'b' of course.) Didn't know you could just use list syntax like that. It's an extra character to type, and two more shift keyings, but brevity isn't always the soul of clarity.
I'm thinking I like to the 'new' tuple-assignment character... ,= ! CHAR ,= b'C' DATE ,= b'D' LOGICAL ,= b'L' ;) ~Ethan~
participants (3)
-
Ethan Furman
-
P.J. Eby
-
Łukasz Langa