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
n?
Thank you,
Jonathan
On Fri, May 6, 2022 at 11:55 PM Greg Ewing
wrote:
> 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
&
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.
Thank you,
Jonathan
On Fri, May 13, 2022 at 8:23 PM
at 1:51 PM Eryk Sun wrote:
> 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, lik