[python] Support more operators overload (classes) (#188)

This commit is contained in:
Mino1289
2022-03-28 20:59:21 +02:00
committed by GitHub
parent b675a78a87
commit 45229b80cd
2 changed files with 19 additions and 0 deletions

View File

@@ -65,16 +65,20 @@ Q(UnicodeError)
Q(ValueError)
Q(ZeroDivisionError)
Q(_0x0a_)
Q(__abs__)
Q(__add__)
Q(__and__)
Q(__bool__)
Q(__build_class__)
Q(__call__)
Q(__class__)
Q(__contains__)
Q(__delitem__)
Q(__divmod__)
Q(__enter__)
Q(__eq__)
Q(__exit__)
Q(__floordiv__)
Q(__ge__)
Q(__getattr__)
Q(__getitem__)
@@ -84,28 +88,40 @@ Q(__iadd__)
Q(__import__)
Q(__init__)
Q(__int__)
Q(__invert__)
Q(__isub__)
Q(__iter__)
Q(__le__)
Q(__len__)
Q(__lshift__)
Q(__lt__)
Q(__main__)
Q(__matmul__)
Q(__mod__)
Q(__module__)
Q(__mul__)
Q(__name__)
#if __EMSCRIPTEN__
Q(__ne__)
#endif
Q(__neg__)
Q(__new__)
Q(__next__)
Q(__or__)
Q(__path__)
Q(__pos__)
Q(__pow__)
Q(__qualname__)
Q(__repl_print__)
Q(__repr__)
Q(__reversed__)
Q(__rshift__)
Q(__setitem__)
Q(__str__)
Q(__sub__)
Q(__traceback__)
Q(__truediv__)
Q(__xor__)
Q(_brace_open__colon__hash_b_brace_close_)
Q(_lt_dictcomp_gt_)
Q(_lt_genexpr_gt_)

View File

@@ -115,6 +115,9 @@
// Whether to support rounding of integers (incl bignum); eg round(123,-1)=120
#define MICROPY_PY_BUILTINS_ROUND_INT (1)
// Wheter to support all the special methods for custom classes
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
// Function to seed URANDOM with on init
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC micropython_port_random()