Skip to content
Snippets Groups Projects
Select Git revision
  • d720ab5236015124a13c09175ed674e565414faa
  • wip-bootstrap default
  • dualcore
  • ch3/leds
  • ch3/time
  • master
6 results

obj.h

  • Paul Sokolovsky's avatar
    d720ab52
    Implement modules as singletons Python semantics. · d720ab52
    Paul Sokolovsky authored
    In Python, importing module several times returns same underlying module
    object. This also fixes import statement handling for builtin modules.
    
    There're still issues:
    1. CPython exposes set of loaded modules as sys.modules, we may want to
    do that either.
    2. Builtin modules are implicitly imported, which is not really correct.
    We should separate registering a (builtin) module and importing a module.
    CPython keeps builtin module names in sys.builtin_module_names .
    d720ab52
    History
    Implement modules as singletons Python semantics.
    Paul Sokolovsky authored
    In Python, importing module several times returns same underlying module
    object. This also fixes import statement handling for builtin modules.
    
    There're still issues:
    1. CPython exposes set of loaded modules as sys.modules, we may want to
    do that either.
    2. Builtin modules are implicitly imported, which is not really correct.
    We should separate registering a (builtin) module and importing a module.
    CPython keeps builtin module names in sys.builtin_module_names .