Message230559
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. |
|
Date |
User |
Action |
Args |
2014-11-03 20:21:46 | ethan.furman | set | recipients:
+ ethan.furman, rhettinger, pitrou, r.david.murray, Jim.Jewett, Joshua.Chin |
2014-11-03 20:21:46 | ethan.furman | set | messageid: <1415046106.85.0.444028052201.issue22766@psf.upfronthosting.co.za> |
2014-11-03 20:21:46 | ethan.furman | link | issue22766 messages |
2014-11-03 20:21:46 | ethan.furman | create | |
|