Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
98c4bc3f
Commit
98c4bc3f
authored
Jan 30, 2015
by
Paul Sokolovsky
Browse files
py: Add MICROPY_PY_ALL_SPECIAL_METHODS and __iadd__ special method under it.
parent
32bade19
Changes
4
Hide whitespace changes
Inline
Side-by-side
py/mpconfig.h
View file @
98c4bc3f
...
...
@@ -376,6 +376,12 @@ typedef double mp_float_t;
#define MICROPY_PY_BUILTINS_PROPERTY (1)
#endif
// Whether to support complete set of special methods
// for user classes, otherwise only the most used
#ifndef MICROPY_PY_ALL_SPECIAL_METHODS
#define MICROPY_PY_ALL_SPECIAL_METHODS (0)
#endif
// Whether to support compile function
#ifndef MICROPY_PY_BUILTINS_COMPILE
#define MICROPY_PY_BUILTINS_COMPILE (0)
...
...
py/objtype.c
View file @
98c4bc3f
...
...
@@ -378,9 +378,11 @@ const qstr mp_binary_op_method_name[] = {
MP_BINARY_OP_INPLACE_XOR,
MP_BINARY_OP_INPLACE_AND,
MP_BINARY_OP_INPLACE_LSHIFT,
MP_BINARY_OP_INPLACE_RSHIFT,
MP_BINARY_OP_INPLACE_ADD,
MP_BINARY_OP_INPLACE_SUBTRACT,
MP_BINARY_OP_INPLACE_RSHIFT,*/
#if MICROPY_PY_ALL_SPECIAL_METHODS
[
MP_BINARY_OP_INPLACE_ADD
]
=
MP_QSTR___iadd__
,
#endif
/*MP_BINARY_OP_INPLACE_SUBTRACT,
MP_BINARY_OP_INPLACE_MULTIPLY,
MP_BINARY_OP_INPLACE_FLOOR_DIVIDE,
MP_BINARY_OP_INPLACE_TRUE_DIVIDE,
...
...
py/qstrdefs.h
View file @
98c4bc3f
...
...
@@ -75,6 +75,9 @@ Q(__eq__)
Q
(
__le__
)
Q
(
__ge__
)
Q
(
__reversed__
)
#if MICROPY_PY_ALL_SPECIAL_METHODS
Q
(
__iadd__
)
#endif
Q
(
micropython
)
Q
(
bytecode
)
...
...
unix/mpconfigport.h
View file @
98c4bc3f
...
...
@@ -59,6 +59,7 @@
#define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_BUILTINS_COMPILE (1)
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
#define MICROPY_PY_SYS_EXIT (1)
#define MICROPY_PY_SYS_PLATFORM "linux"
#define MICROPY_PY_SYS_MAXSIZE (1)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment