<div dir="auto">Let's make it so.</div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 23, 2018, 08:53 Terry Reedy <<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 6/23/2018 4:54 AM, Serhiy Storchaka wrote:<br>
> 23.06.18 10:27, Jeroen Demeyer пише:<br>
>> On 2018-06-23 03:50, Steven D'Aprano wrote:<br>
>>> I think it is more important that builtin methods and Python methods<br>
>>> behave the same.<br>
>><br>
>> +1<br>
>><br>
>> This inconsistency is the *real* problem here. It's one little extra <br>
>> complication to merging those classes (which was proposed in PEP 575, <br>
>> 576 and 579).<br>
> <br>
> +1 too. But I think the right solution should be opposite: reverting <br>
> issue1350060 changes and making all methods equality be based on the <br>
> identity of __self__.<br>
<br>
We 3, and Armin Rigo, it appears, agree that equivalent C and Python <br>
coded functions should act the same in comparisons.  Abstractly, in <br>
English, one might say that a.m equals b.m is true if they perform the <br>
same action and have the same effect.<br>
<br>
The problem, even after adding a stipulation of same type, is that the <br>
nature of 'action and effect' are different for pure function methods <br>
versus mutation methods.  Since pure functions ignore the identify of a <br>
and b, so should a.pure_func == b.pure_func.  a == b is the right test. <br>
For example, a.bit_length == b.bit_length should be true, not false, if <br>
a == b.  On the other hand, identify is essential for mutation methods, <br>
so 'a is b' is the right test, as for .append.<br>
<br>
But without functions having an 'I mutate' flag, '==' cannot know which <br>
comparison of a and b to use, so we have to choose one, and the choice <br>
should not depend on the coding language. 'a == b' leads to false <br>
positives; 'a is b' leads to false negatives.  I don't know how method <br>
comparison is actually used, if ever, but false negatives seem safer to <br>
me.  So I currently agree with Serhiy's choice.<br>
<br>
-- <br>
Terry Jan Reedy<br>
<br>
<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank" rel="noreferrer">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</blockquote></div>