Message7353

Author pjenvey
Recipients Arfrever, fwierzbicki, pjenvey
Date 2012-08-04.18:56:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344106570.3.0.334579904794.issue1955@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2012-08-04 18:56:10pjenveysetmessageid: <1344106570.3.0.334579904794.issue1955@psf.upfronthosting.co.za>
2012-08-04 18:56:10pjenveysetrecipients: + pjenvey, fwierzbicki, Arfrever
2012-08-04 18:56:10pjenveylinkissue1955 messages
2012-08-04 18:56:09pjenveycreate