bpo-20092: Make __int__ defaults to __index__#13106
Conversation
jdemeyer
left a comment
There was a problem hiding this comment.
Instead of handling this on the level of the Python __dict__, wouldn't it be better to handle this in nb_int? That is, set nb_int to nb_index. That way, it's also guaranteed to work for extension types defining only nb_index.
Sorry, something went wrong.
|
@jdemeyer, I was not absolutly clear with how the methods that have a slot interact with I will push a commit to update the slots instead of |
Sorry, something went wrong.
It's complicated, I would have to look up the details myself. But basically, the slots are used to put entries in the |
Sorry, something went wrong.
|
Thanks @jdemeyer, I think the last change should be good to make |
Sorry, something went wrong.
|
What I meant is that should only do and then the wrapper descriptor |
Sorry, something went wrong.
|
This doesn't seem to work, with this: I get: |
Sorry, something went wrong.
|
Please post your failing branch, otherwise it's hard to guess what the problem is. |
Sorry, something went wrong.
https://bugs.python.org/issue33039