[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] I have had a bg but...



Fredrik Aronsson wrote:
> This is a python language feature
> "a in b" returns true if the value a is in the tuple b
(snip)
> This information should be in the Python tutorial somewhere, but I 
> didn't find it.... someone else knows where to find it?
Found it in the language reference atleast... 
http://www.python.org/doc/current/ref/comparisons.html

"The operators in and not in test for set membership. x in s evaluates 
to true if x is a member of the set s, and false otherwise. x not in s 
returns the negation of x in s. The set membership test has 
traditionally been bound to sequences; an object is a member of a set if 
the set is a sequence and contains an element equal to that object. 
However, it is possible for an object to support membership tests 
without being a sequence. In particular, dictionaries support memership 
testing as a nicer way of spelling key in dict; other mapping types may 
follow suit. "

/Fredrik

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org