[Tutor] True and 1 [was Re: use of the newer dict types]

Jim Mooney cybervigilante at gmail.com
Sat Jul 27 21:17:24 CEST 2013


On 27 July 2013 11:36, Steven D'Aprano <steve at pearwood.info> wrote:

>
> L = []
> L.append(L)
> [L] == L
>
> True or false? Can you explain why?

Since I admitted to still being a bit confused, I though it out, and:

>>> [[[[[L]]]]] == L
True

False propagates outward, since each containing bracket also contains
an empty object.

---
Jim
Fair trade: Walmart sends our jobs to China. They send Chinese wages
back to us. Seems fair to me  ;')


More information about the Tutor mailing list