On 12/27/05, Scott David Daniels <[EMAIL PROTECTED]> wrote:
> Tell me:
> >>> a = [0] * 3
> >>> b = [0] * 3
> >>> a[0] = b
> >>> b[0] = a
>
> What order should a and b have?
More gems:
>>> Decimal(3) < 4.0
False
>>> Decimal(3) == 3.0
False
>>> Decimal(3) > 4.0
True
And the pièce de résistance:
>>> l = [2.0, Decimal(3), 3.5, Decimal(4), 5, 3]
>>> for i in range(5): random.shuffle(l); print sorted(l)
[2.0, Decimal("3"), 3, 3.5, Decimal("4"), 5]
[2.0, 3.5, Decimal("3"), 3, Decimal("4"), 5]
[2.0, Decimal("3"), 3, 3.5, Decimal("4"), 5]
[2.0, 3.5, Decimal("3"), 3, Decimal("4"), 5]
[2.0, 3, 3.5, Decimal("3"), Decimal("4"), 5]
(The positions of 3 and Decimal("3") should be swapping, but the
position of 3.5 should not.)
--
Adam Olsen, aka Rhamphoryncus
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com