<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Dec 26, 2015 at 5:09 PM, Serhiy Storchaka <span dir="ltr"><<a href="mailto:storchaka@gmail.com" target="_blank">storchaka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 27.12.15 01:05, Guido van Rossum wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
There is a precedent for declaring that a method isn't implemented:<br>
__hash__. The convention is to set it to None in the subclass that<br>
explicitly doesn't want to implement it. The __subclasshook__ in<br>
collections.Hashable checks for this. The pattern is also used for<br>
__await__.<br>
</blockquote>
<br></span>
Yes, this was the first thing that I tried, but it doesn't work, as shown in my example in issue25864. This is yet one thing that should be fixed in Reversible.<br></blockquote><div><br></div><div>Yeah, sorry, I didn't mean it already works. I just meant that we should adopt the same convention here.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
May be we have to use this idiom more widely, and specially handle assigning special methods to None. The error message "'sometype' can't be reverted" looks better than "'NoneType' is not callable".<br></blockquote></div><br></div><div class="gmail_extra">Yes, that's what I'm proposing. Just like hash() says "TypeError: unhashable type: 'list'" instead of "TypeError: 'NoneType' object is not callable" or "AttributeError: 'list' object has no attribute '__hash__'".<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>