Message7353
The problem here is that PyInstance#__add__ does not follow the contract of PyObject#__add__ in that it must return null when a user defined add impl returns NotImplemented
Currently PyInstance#instance___add__ defers to invoke_ex to do the work. However there's an invoke_ex_richcmp method that is doing the right thing (returning null for NotImplemented). Either that method should be used instead (and more appropriately renamed) or maybe invoke_ex should just adopt that logic.
Note that this problem affects likely every binary op in PyInstance, not just add (which is one reason why invoke_ex might have to adopt the logic).
So this fix could use a few more tests other than add. You *might* be able to recycle some of test_descr_jy.BinopCombinationsTestCase for this (but there's no need to go overboard) |
|
Date |
User |
Action |
Args |
2012-08-04 18:56:10 | pjenvey | set | messageid: <1344106570.3.0.334579904794.issue1955@psf.upfronthosting.co.za> |
2012-08-04 18:56:10 | pjenvey | set | recipients:
+ pjenvey, fwierzbicki, Arfrever |
2012-08-04 18:56:10 | pjenvey | link | issue1955 messages |
2012-08-04 18:56:09 | pjenvey | create | |
|