>By convention mutable types always implement __ixxx__ differently from
>__xxx__. 
>
>
>Really? That's a convention I've not come across before.
>
>
>And here's another example:
>
>>>> c = ([],)
>>>> c[0] += [1]
>
>Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>TypeError: 'tuple' object does not support item assignment
>>>> c
>([1],)
>Good catch, I should have thought about that because I have seen it before.
Yes, that is an example where the duality breaks (although at least it warns 
you via the exception).

Thanks,

Alan G
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to