diff options
| author | Paul Sokolovsky | 2015-05-04 19:45:53 +0300 |
|---|---|---|
| committer | Paul Sokolovsky | 2015-05-04 19:45:53 +0300 |
| commit | 5ab5ac5448573fa34cc2316d895706c24a412f36 (patch) | |
| tree | 4300caa3782f3d9fd2da31e99117bdc69922d7f9 /py/mpconfig.h | |
| parent | 3d3ef36e977b5f5a4153b8df6447f3f73e4726e3 (diff) | |
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).
Diffstat (limited to 'py/mpconfig.h')
| -rw-r--r-- | py/mpconfig.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index a5aacc8b0..560fdce9c 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -479,6 +479,11 @@ typedef double mp_float_t; #define MICROPY_PY_BUILTINS_REVERSED (1) #endif +// Whether to define "NotImplemented" special constant +#ifndef MICROPY_PY_BUILTINS_NOTIMPLEMENTED +#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) +#endif + // Whether to set __file__ for imported modules #ifndef MICROPY_PY___FILE__ #define MICROPY_PY___FILE__ (1) |
