Re: reloading code and multiprocessing

Discussion in 'Python' started by Chris Angelico, Jul 23, 2012.

  1. On Mon, Jul 23, 2012 at 11:51 PM, andrea crotti
    <> wrote:
    > Anyway the only other problem which I found is that if I start the
    > subprocesses after many other things are initialised, it might happen
    > that the reloading doesn't work correctly, is that right?
    >
    > Because sys.modules will get inherited from the subprocesses and it
    > will not reimport what has been already imported as far as I
    > understood..
    >
    > So or I make sure I import everything only where it is needed or (and
    > maybe better and more explicit) I remove manually from sys.modules all
    > the modules that I want to reload, what do you think?


    That would probably be correct. However, I still think you may be
    fighting against the language instead of playing to its strengths.

    I've never fiddled with sys.modules like that, but I know some have,
    without problem.

    ChrisA
    Chris Angelico, Jul 23, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. andrea crotti

    reloading code and multiprocessing

    andrea crotti, Jul 19, 2012, in forum: Python
    Replies:
    2
    Views:
    175
    88888 Dihedral
    Jul 19, 2012
  2. Chris Angelico

    Re: reloading code and multiprocessing

    Chris Angelico, Jul 20, 2012, in forum: Python
    Replies:
    0
    Views:
    121
    Chris Angelico
    Jul 20, 2012
  3. andrea crotti

    Re: reloading code and multiprocessing

    andrea crotti, Jul 23, 2012, in forum: Python
    Replies:
    0
    Views:
    147
    andrea crotti
    Jul 23, 2012
  4. andrea crotti

    Re: reloading code and multiprocessing

    andrea crotti, Jul 25, 2012, in forum: Python
    Replies:
    0
    Views:
    193
    andrea crotti
    Jul 25, 2012
  5. andrea crotti

    Re: reloading code and multiprocessing

    andrea crotti, Jul 27, 2012, in forum: Python
    Replies:
    0
    Views:
    159
    andrea crotti
    Jul 27, 2012
Loading...

Share This Page