From f0ffe0ec3c6b1cee626a1a4619f3bb9a1442ff0c Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sun, 29 Jun 2025 21:13:12 -0500 Subject: [PATCH] py: Make math and cmath modules extensible. Change math and cmath module registration from normal to extensible. This way users can extend the modules to add any missing functions. Signed-off-by: David Lechner --- py/modcmath.c | 2 +- py/modmath.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py/modcmath.c b/py/modcmath.c index 33cb00cbe7e69..9ff3e90967072 100644 --- a/py/modcmath.c +++ b/py/modcmath.c @@ -149,6 +149,6 @@ const mp_obj_module_t mp_module_cmath = { .globals = (mp_obj_dict_t *)&mp_module_cmath_globals, }; -MP_REGISTER_MODULE(MP_QSTR_cmath, mp_module_cmath); +MP_REGISTER_EXTENSIBLE_MODULE(MP_QSTR_cmath, mp_module_cmath); #endif // MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_BUILTINS_COMPLEX && MICROPY_PY_CMATH diff --git a/py/modmath.c b/py/modmath.c index 919a8ccd9d3c0..67240a2affb27 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -450,6 +450,6 @@ const mp_obj_module_t mp_module_math = { .globals = (mp_obj_dict_t *)&mp_module_math_globals, }; -MP_REGISTER_MODULE(MP_QSTR_math, mp_module_math); +MP_REGISTER_EXTENSIBLE_MODULE(MP_QSTR_math, mp_module_math); #endif // MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_MATH pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy