This is useful in the context of reducing the available methods and operator overloading, when subclassing a type.
Typically, when subclassing a NamedTuple type, you often don't want the <, >, <=, >=, + or * operators to work, so in that case you would want for the related methods to return NotImplemented.
This can be done with (and I hope triple-backquotes markdown works here) :
def NotImplementedMethod(self, other):
__le__ = __lt__ = __ge__ = __gt__ = __mul__ = __rmul__ = __add__ = __radd__ = NotImplementedMethod
This is very handy, and I think it should be added to the builtins.
A simple way to implement this could be to have `NotImplemented(a, b)` return NotImplemented for any value of a and b, so that NotImplemented can be used instead of NotImplementedMethod in the above example.
A caveat for that version, and the reason I would not recommand it, is that it makes NotImplemented a callable when it doesn't need to be, and probably shouldn't be.
The other way around, which I'm recommanding, is to add the NotImplementedMethod, working as-is but implement it in C, so that it has no inner dict, is lightweight and less prone to programmer mismanagement (making it a builtin_function_or_method instead of a function).