Thank you for your response Eryk.
I did try using gdb in my original post, but using breakpoint() left me in
the python layer (pdb), not the cpython layer (gdb) and I couldn't figure
out how to drop down.
I see you're using the kernel32 library, so I assume you're on windows. I
only have a mac an
On 5/14/22, Jonathan Kaczynski wrote:
>
> So, I'm still wondering how Py_TYPE(v)->tp_richcompare resolves to __eq__
> on a user-defined class. Conversely, my understanding is, for a type
> defined in cpython, like str, there is usually an explicitly
> defined tp_richcompare function.
Sometimes it
Trying some new searches, I came across slotdefs in ./Objects/typeobject.c,
and those are used in the resolve_slotdups function.
The comment preceding the function says, "Note that multiple names may map
to the same slot (e.g. __eq__, __ne__ etc. all map to tp_richcompare)".
So, I'm still wonderi
Thank you for your responses, Sam and Greg.
The do_richcompare function is where my research originally took me, but I
feel like I'm still missing some pieces to the puzzle.
Here is my updated research since you posted your responses (I'll attach a
pdf copy too):
https://docs.google.com/document/
On 7/05/22 12:22 am, Jonathan Kaczynski wrote:
Stepping through the code with gdb, we see it jump from the compare
operator to the dunder-eq method on the UUID object. What I want to be able
to do is explain the in-between steps.
Generally what happens with infix operators is that the interpret
Perhaps these source references are useful:
Python/ceval.c (_PyEval_EvalFrameDefault)
https://github.com/python/cpython/blob/main/Python/ceval.c#L3754-L3768
Objects/object.c (do_richcompare)
https://github.com/python/cpython/blob/42fee931d055a3ef8ed31abe44603b9b2856e04d/Objects/object.c#L661-L713
Hi,
I was recently trying to explain how python equality works and ran into a
gap in my knowledge. I haven't found any good pages going beneath a surface
level explanation of python equality comparison.
I'll post my investigations below. What I think I'm looking for is where in
the source code (h