Ethan Furman added the comment:

Okay, the python-dev ruling is in, and raising an exception in the __ixxx__ 
methods is allowed, and even a good idea in the cases of mutable containers.

However, doing the check on 'other' and raising a TypeError with an appropriate 
message would still be better for a couple reasons:

  - all the non-inplace operations raise TypeError when 'other' is not a 
correct type
  - __iand__ is currently buggy because it does not do the check

If backwards compatibility is a concern in this case, a custom "TypeError" that 
was a subclass of both TypeError and AttributeError could address that.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22766>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to