<div dir="ltr">No, raising NotImplementedError means that a subclass was supposed to implement the method. In this case it's different -- it should appear as if the method isn't implemented to code that checks for the method's presence. Introspecting whether the code raises NotImplementedError is unfeasible. We explicitly decided that setting the method to None indicates that it should be considered as absent by code that checks for the method's presence.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 26, 2015 at 4:23 PM, Ben Finney <span dir="ltr"><<a href="mailto:ben+python@benfinney.id.au" target="_blank">ben+python@benfinney.id.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> writes:<br>
<br>
> 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.<br>
<br>
</span>Isn't â€˜raise NotImplementedError’ the more explicit convention provided<br>
by Python (as a built-in, explicitly-named exception!) for communicating<br>
this meaning?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
 \  Â  Â  Â  â€œ[It's] best to confuse only one issue at a time.” â€”Brian W. |<br>
  `\  Kernighan, Dennis M. Ritchie, _The C programming language_, 1988 |<br>
_o__)  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  |<br>
Ben Finney<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div>