On Apr 26, 2011, at 7:13 AM, pierreth wrote: > > Oups, reload does not take a string but a module object so forget the > quotes. > > It would be difficult to change the behavior of reload. > > Is reload(my_module) working? I didn't try.
It'd be worth testing. In fact, how about a unit test module for both flavors of import (local & custom)? I'd *expect* reload(my_module) to work, since it works in local_import, which has a somewhat similar agenda, but of course it needs testing. > > On 26 avr, 10:04, pierreth <[email protected]> wrote: >> On 26 avr, 08:28, Massimo Di Pierro <[email protected]> >> wrote: >> >>> import my_module # not right now always assumes reload=False (I >>> think). >> >> Yes, assume reload is False. This is the normal behavior for Python. >> So the code can be: >> >> if "my_module" in dir() and DEBUG: >> reload("applications.my_app.modules.my_modules") >> import my_modules >> >> reload is working the way it was. Would it be better to adapt it so we >> can simply write "reload('my_module')"?

