Skip to content

Conversation

yonmilk
Copy link
Contributor

@yonmilk yonmilk commented Jul 17, 2022

No description provided.

op: PyComparisonOp,
vm: &VirtualMachine,
) -> PyResult<PyComparisonValue> {
println!("richcompare");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
println!("richcompare");

vm: &VirtualMachine,
) -> PyResult<PyComparisonValue> {
println!("richcompare");
op.eq_only(|| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does weakproxy only support eq operation?
What happens if the proxy object is int and used for > operation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked cpython source code and it simply calls PyObject_RichCompare, which is PyObjectRef::rich_compare in RustPython.

@youknowone youknowone added the z-ca-2022 Tag to track contrubution-academy 2022 label Jul 17, 2022
vm: &VirtualMachine,
) -> PyResult<PyComparisonValue> {
println!("richcompare");
op.eq_only(|| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked cpython source code and it simply calls PyObject_RichCompare, which is PyObjectRef::rich_compare in RustPython.

@yonmilk yonmilk force-pushed the weakref_richcompare branch 2 times, most recently from 721cc74 to a212d84 Compare July 17, 2022 16:58
Co-Authored-By: Hyunmin Shin <shm1193@gmail.com>
@yonmilk yonmilk force-pushed the weakref_richcompare branch from a212d84 to 5c08546 Compare July 17, 2022 17:00
Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thank you!

@youknowone youknowone merged commit 242e511 into RustPython:main Jul 17, 2022
@yonmilk yonmilk deleted the weakref_richcompare branch July 17, 2022 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
z-ca-2022 Tag to track contrubution-academy 2022
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants