Add BaseException.__reduce__#3665
Conversation
|
Looks good! This PR can be a good specimen for the other remaining works. Does "three items" mean |
Yes. I only had to add things to |
|
Unfortunately, OSError's and ImportError's reduce act different than BaseException's 😭 |
I would direct future contributors to look at the |
|
Ok good 😊. Except for the issue about the empty set that I commented on, everything seems fine. |
youknowone
left a comment
There was a problem hiding this comment.
great, thank you! @Snowapril and thank you for the review!
| } | ||
|
|
||
| #[pymethod(magic)] | ||
| fn reduce(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyTupleRef { |
There was a problem hiding this comment.
If it doesn't require type checking, this may be:
| fn reduce(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyTupleRef { | |
| fn reduce(zelf: PyObjectRef, vm: &VirtualMachine) -> PyTupleRef { |
There was a problem hiding this comment.
It doesn't work in practice because rustc will complain:
no method named `args` found for struct `core::PyObjectRef` in the current scope
method not found in `core::PyObjectRef`
Addresses three items in #3611.
cc @Snowapril