Re: very rare python expression

2008-08-13 Thread Fredrik Lundh
Edward A. Falk wrote: It parses as "x & 528 or x in l". Looks like it came from http://www.pygame.org/project/833/ and is an attempt to squash the program to as few bytes as possible. Sheesh. The 80's called; they want their floppy drives back. Even with the whitespace restored, it's awf

Re: very rare python expression

2008-08-12 Thread Edward A. Falk
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >"ðÏ" <[EMAIL PROTECTED]> writes: >> I saw a strange python code in pygame project. What does "while >> not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" >> is not HTML strings. > >It parses as "x & 52

Re: very rare python expression

2008-08-12 Thread Tim Golden
甜瓜 wrote: Howdy everyone, I saw a strange python code in pygame project. What does "while not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" is not HTML strings. Well I can't say I'd format it that way myself, but it is valid. More conventionally laid out the expression look

Re: very rare python expression

2008-08-12 Thread 甜瓜
Oh, thank you very much. I did know that python can parse number '528' and keyword 'or' without separator. 2008/8/12 Paul Rubin <"http://phr.cx"@nospam.invalid>: > "ðÏ" <[EMAIL PROTECTED]> writes: >> I saw a strange python code in pygame project. What does "while >> not(x&528or x in l):" mean? Bel

Re: very rare python expression

2008-08-12 Thread Tim Golden
甜瓜 wrote: Howdy everyone, I saw a strange python code in pygame project. What does "while not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" is not HTML strings. Well I can't say I'd format it that way myself, but it is valid. More conventionally laid out the expression look

Re: very rare python expression

2008-08-12 Thread Wojtek Walczak
Dnia Tue, 12 Aug 2008 16:39:27 +0800, =?GB2312?B?zPC5zw==?= napisa�(a): > Howdy everyone, > > I saw a strange python code in pygame project. What does "while > not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" > is not HTML strings. It looks like a check if 528 flag is set. In

Re: very rare python expression

2008-08-12 Thread Alexandru Palade
Nothing strange about that syntax (though some spaces might helped you out). The '&' operator is a bit-wise operator (http://docs.python.org/ref/bitwise.html). 甜瓜 wrote: Howdy everyone, I saw a strange python code in pygame project. What does "while not(x&528or x in l):" mean? Below code works

Re: very rare python expression

2008-08-12 Thread Paul Rubin
"ðÏ" <[EMAIL PROTECTED]> writes: > I saw a strange python code in pygame project. What does "while > not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" > is not HTML strings. It parses as "x & 528 or x in l". Looks like it came from http://www.pygame.org/project/833/ and is

very rare python expression

2008-08-12 Thread 甜瓜
Howdy everyone, I saw a strange python code in pygame project. What does "while not(x&528or x in l):" mean? Below code works in python2.5, so "x&528" is not HTML strings. # snake.py code: import pygame as p,random p.init() q=p.display T=16 b=q.set_mode([256]*2).fill l=[] d=a=x=1 c=p.event.get whi