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 this way you can set
more than one flag in signle variable:

>>> flag1 = 1
>>> flag2 = 2
>>> flag3 = 4
>>> flag4 = 8
>>> flag5 = 10
>>> flags_set = flag2 | flag4
>>> flags_set & flag1
0
>>> flags_set & flag2
2
>>> flags_set & flag3
0
>>> flags_set & flag4
8
>>> flags_set & flag5
0


-- 
Regards,
Wojtek Walczak,
http://www.stud.umk.pl/~wojtekwa/
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to