You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BuiltinFunctionType and BuiltinMethodType are different #3100
types.BuiltinFunctionType must be equal to types.BuiltinMethodType.
In other word, types returned by builtin function and types returned by builtin method must be of the same type.
Note: I think must be equal is a bit too strong in this case, I don't believe there's a requirement that these be equal. It would be nice if they would, though.
changed the title [-]compatible issue: `BuiltinFunctionType` and `BuiltinMethodType` are different[/-][+]`BuiltinFunctionType` and `BuiltinMethodType` are different[/+]on Sep 21, 2021
Maybe, we can adapt the optimization idea but not about the exact types.
CPython internally uses PyCMethod but expose it as PyCFunction. I think that will be very tricky in rust.
Activity
DimitrisJim commentedon Sep 21, 2021
Note: I think must be equal is a bit too strong in this case, I don't believe there's a requirement that these be equal. It would be nice if they would, though.
[-]compatible issue: `BuiltinFunctionType` and `BuiltinMethodType` are different[/-][+]`BuiltinFunctionType` and `BuiltinMethodType` are different[/+]Tetramad commentedon Sep 21, 2021
Sorry for my bad english. I can't find words other than 'must be', 'should be'.
"It would be nice if they would", that's what I wanted to say. ;)
youknowone commentedon Oct 6, 2021
Roughly, adding
zelf: Option<PyObjectRef>toPyBuiltinFunctionand replacingPyBoundMethodtoPyBuiltinFunctionwill solve it.It looks like a good next-step issue for who understand how python binding works and finished a few good first issues.
Snowapril commentedon Jul 6, 2022
@youknowone This issue seems fixed.Oh sorry, my mistake
moreal commentedon Jul 25, 2022
I'm working on this issue. I left this comment to avoid task conflicts.
seungha-kim commentedon Mar 9, 2023
I'll take a look!
youknowone commentedon Apr 17, 2023
Maybe, we can adapt the optimization idea but not about the exact types.
CPython internally uses
PyCMethodbut expose it asPyCFunction. I think that will be very tricky in rust.youknowone commentedon May 20, 2023
Partially resolved by #4873
I decide not to strictly follow CPython implementation for this behavior. We expose BuiltinMethodType to user.