Hi.

I'm looking at stuff proposed over on Python-Ideas, and I'd appreciate some pointers as to the basics of how C-level objects are generally compared in Python 3.

The issue is related to the performance of PyObject_RichCompare. I got to the point where I was trying to work out what was the _alternative_ to RichCompare. If a comparison is not "rich", then what is it? There's a tp_richcompare slot in the type structure, but I haven't noticed anything else obvious for simple comparison (In 2.x days - which I have more experience with - __cmp__ was a thing which now seems to be gone. I understand the Python-level changes with sort(..., key=foo) but I've not looked at the underlying C implementation until now).


Anyway, I followed things as far as Objects/typeobject.c and then I got bitten by a macro dialect that I don't immediately grok, so anything that spells it out a bit more plainly would be nice (I can follow the code if I need to - but a shortcut from those who know this off the top of their head would be helpful).

Thanks, E.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to