Re: forcing future re-import from with an imported module

2008-12-12 Thread Gabriel Genellina
En Fri, 12 Dec 2008 19:44:32 -0200, _wolf escribió: On Dec 11, 12:43 am, rdmur...@bitdance.com wrote: "Why can't you have the code that is doing the import [...] call a function [...] to produce [the] side effect [...]? Explicit is better than implicit. A python programmer is going to expec

Re: forcing future re-import from with an imported module

2008-12-12 Thread _wolf
On Dec 11, 12:43 am, rdmur...@bitdance.com wrote: > "Why can't you have the code that is doing the import [...] > call a function [...] to produce [the] side effect [...]? > Explicit is better than implicit. A python programmer is > going to expect that importing a module is idempotent" you’re co

Re: forcing future re-import from with an imported module

2008-12-10 Thread rdmurray
On Wed, 10 Dec 2008 at 14:53, _wolf wrote: thanks for your answer. i am aware that imports are not designed to have side-effects, but this is exactly what i want: to trigger an action with `import foo`. you get foo, and doing this can have a side- effect for the module, in roughly the way that a

Re: forcing future re-import from with an imported module

2008-12-10 Thread _wolf
On Dec 10, 1:46 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 09 Dec 2008 23:27:10 -0200, _wolf <[EMAIL PROTECTED]> > escribió: > > > how can i say, approximately, "re-import the present module when it is > > imported the next time, don’t use the cache" in a simple way? i do not > >

Re: forcing future re-import from with an imported module

2008-12-10 Thread Gabriel Genellina
En Tue, 09 Dec 2008 23:27:10 -0200, _wolf <[EMAIL PROTECTED]> escribió: how can i say, approximately, "re-import the present module when it is imported the next time, don’t use the cache" in a simple way? i do not want to "reload" the module, that doesn’t help. I'd say you're using modules t

forcing future re-import from with an imported module

2008-12-09 Thread _wolf
following problem: i have a module importer_1 that first imports importer_2, then importee. importer_2 also imports importee. as we all know, follow-up imports are dealt out from the cache by python’s import mechanism, meaning the importee file gets only cached once. i can force module-level code i