python - why would load_module be called if the module is already in sys.modules? -


pep302 says load_module must return entry in sys.modules if 1 exists. seems unnecessary burden, because caller (i.e. python's import system) could in sys.modules before calling load_module, , notice load_module has no real work (but not reason?).

if idea notify loader import being attempted, seems calling my_loader.already_loaded(module) (or similar interface) better, because then, load_module can focus on it's "real" job, , not have worry whether module in sys.modules.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -