[Tutor] list objects are unhashable

Alan Gauld alan.gauld at btinternet.com
Tue Jul 1 12:27:17 CEST 2008


"Kent Johnson" <kent37 at tds.net> wrote 
>>            if isinstance(x, list):
>>                for item in x:
>>                    x = item
> 
> This just assigns x to the last element of the list

Oops, yes, I said the first but in fact reassigning x does 
not stop the loop, it seems the loop works on a local 
copy of the original reference.

Alan G



More information about the Tutor mailing list