[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2014-06-24 Thread Amitava Bhattacharyya
Amitava Bhattacharyya added the comment: I did fill in the contributor agreement form and e-signed it, maybe it takes some time for my profile to be updated? But I guess I need to wait for the corporate agreement. :) -- ___ Python tracker <h

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2014-06-24 Thread Amitava Bhattacharyya
Amitava Bhattacharyya added the comment: Hi Ethan, I tried adding a call to `nb_index` (if that slot exists) in `_PyLong_FromNbInt`, but that didn't work. Based on your comment it seems the fix would be to patch this at object creation. I will check where that happens (bear with me wh

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2014-06-22 Thread Amitava Bhattacharyya
Amitava Bhattacharyya added the comment: I started working on this issue as part of the Bloomberg Python Sprint (https://etherpad.mozilla.org/LjZPQ55oZs). Ethan, can you confirm if the attached test case summarizes the issue correctly? I tried to hook _PyLong_FromNbInt to check nb_index but