Are all items in list the same?

ike at koeln.ccc.de ike at koeln.ccc.de
Tue Jan 8 14:15:03 EST 2019


On Tue, Jan 08, 2019 at 01:05:09PM +1100, Chris Angelico wrote:
> No, because the iteration would never happen. If the list is empty,
> a[1:] is also empty, and i==a[0] will never be evaluated. So it is
> safe. (But I agree that it's not instantly obvious.)

Oh yeah, you're right. I overthought it too much. :)



More information about the Python-list mailing list