<div dir="ltr"><div dir="ltr">So we're making pretty heavy use of PyInstanceMethod_New in our python binding library that we've written for a bunch of in house tools. </div><div>If this isn't the best / correct way to go about adding methods to objects, what should we be using instead?</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 7, 2019 at 2:17 AM Jeroen Demeyer <<a href="mailto:J.Demeyer@ugent.be">J.Demeyer@ugent.be</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2019-04-07 09:48, Serhiy Storchaka wrote:<br>
> total_ordering monkeypatches the decorated class. I'm planning to<br>
> implement in C methods that implement __gt__ in terms of __lt__ etc.<br>
<br>
Yes, I understood that. I'm just saying: if you want to make it fast, <br>
that's not the best solution. The fastest would be to implement <br>
tp_richcompare from scratch (instead of relying on slot_tp_richcompare <br>
dispatching to methods).<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/robert.wd.white%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/robert.wd.white%40gmail.com</a><br>
</blockquote></div>