modbuiltins: Add NotImplemented builtin constant.

From https://docs.python.org/3/library/constants.html#NotImplemented :
"Special value which should be returned by the binary special methods
(e.g. __eq__(), __lt__(), __add__(), __rsub__(), etc.) to indicate
that the operation is not implemented with respect to the other type;
may be returned by the in-place binary special methods (e.g. __imul__(),
__iand__(), etc.) for the same purpose. Its truth value is true."

Some people however appear to abuse it to mean "no value" when None is
a legitimate value (don't do that).
This commit is contained in:
Paul Sokolovsky
2015-05-04 19:45:53 +03:00
parent 3d3ef36e97
commit 5ab5ac5448
5 changed files with 20 additions and 0 deletions

View File

@@ -115,6 +115,9 @@ Q(builtins)
Q(Ellipsis)
Q(StopIteration)
#if MICROPY_PY_BUILTINS_NOTIMPLEMENTED
Q(NotImplemented)
#endif
Q(BaseException)
Q(ArithmeticError)