An oddity in list comparison and element assignment
Tim Chase
python.list at tim.thechases.com
Thu Jun 1 12:23:09 EDT 2006
> As to containers, would you say that envelope containing five $100
> bills is the same as an envelope containing a single $100 bill and 4
> xerox copies of it? If so, I'd like to engage in some envelope
> exchanges with you :-)
if len(set([bill.serialnumber for bill in envelope])) !=
len(envelope): refuseMichaelsExchange()
Though the way references work, you would have an envelope
containing only 5 slips of paper that all say "I have a $100
bill"...
:)
-tkc
More information about the Python-list
mailing list