• Jim Mussared's avatar
    py/objmodule: Add a table of built-in modules with delegation. · 13c817e6
    Jim Mussared authored
    
    
    This replaces the previous QSTR_null entry in the globals dict which could
    leak out to Python (e.g. via iteration of mod.__dict__) and could lead to
    crashes.
    
    It results in smaller code size at the expense of turning a lookup into a
    loop, but the list it is looping over likely only contains one or two
    elements.
    
    To allow a module to register its custom attr function it can use the new
    `MP_REGISTER_MODULE_DELEGATION` macro.
    
    This work was funded through GitHub Sponsors.
    Signed-off-by: default avatarJim Mussared <jim.mussared@gmail.com>
    13c817e6
builtinhelp.c 5.72 KB