At 05:15 PM 9/28/2005 +0200, Reinhold Birkenfeld wrote:
>Okay. I assume that we must accept that
>
>s = set()
>t = (s,)
>t[0] |= set([1])
>
>changes s in spite of raising TypeError.

There are lots of operations that can be partially completed before raising 
an error, so I'm not sure why this case would be special.

Sets do have an update() method, however, and it's unambiguous as to being 
an in-place update.  The code above would be clearer using it, and produce 
no errors:

    s = set()
    t = (s,)
    t[0].update([1])

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to