There was a fun thread on Baypiggies today, where someone asked: ---- Can anyone explain the following:
>>>* a = 1*>>>* b = 2*>>>* alist = [5,6]*>>>* print a in alist*False >>>* a in alist == b in alist*False >>>* a in alist == a in alist*False >>>* bool(a in alist) == bool(b in alist) # this does what we expect*True >>>* c = 5*>>>* c in alist == c in alist*False ---- After some guesses and discussion came this cool answer: http://mail.python.org/pipermail/baypiggies/2010-January/006139.html Well worth a read... Dylan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/portland/attachments/20100125/b8eae0aa/attachment.htm> _______________________________________________ Portland mailing list [email protected] http://mail.python.org/mailman/listinfo/portland
