mirror of
https://github.com/micropython/micropython.git
synced 2026-03-18 14:50:18 +01:00
py/objtype: Make mp_obj_new_type a static function.
It's only used once, in the same file it's defined, and making it static reduces code size. Along with this, the associated example code comment in `ports/unix/main.c` has been removed. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#define ENABLE_SPECIAL_ACCESSORS \
|
||||
(MICROPY_PY_DESCRIPTORS || MICROPY_PY_DELATTR_SETATTR || MICROPY_PY_BUILTINS_PROPERTY)
|
||||
|
||||
static mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict);
|
||||
static mp_obj_t mp_obj_is_subclass(mp_obj_t object, mp_obj_t classinfo);
|
||||
static mp_obj_t static_class_method_make_new(const mp_obj_type_t *self_in, size_t n_args, size_t n_kw, const mp_obj_t *args);
|
||||
|
||||
@@ -1164,7 +1165,7 @@ MP_DEFINE_CONST_OBJ_TYPE(
|
||||
attr, type_attr
|
||||
);
|
||||
|
||||
mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict) {
|
||||
static mp_obj_t mp_obj_new_type(qstr name, mp_obj_t bases_tuple, mp_obj_t locals_dict) {
|
||||
// Verify input objects have expected type
|
||||
if (!mp_obj_is_type(bases_tuple, &mp_type_tuple)) {
|
||||
mp_raise_TypeError(NULL);
|
||||
|
||||
Reference in New Issue
Block a user