Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #27617 > unrolled thread

Re: Reimporting modules, and sandboxing?

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2012-08-22 09:13 +0100
Last post2012-08-22 09:13 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Reimporting modules, and sandboxing? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-08-22 09:13 +0100

#27617 — Re: Reimporting modules, and sandboxing?

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2012-08-22 09:13 +0100
SubjectRe: Reimporting modules, and sandboxing?
Message-ID<mailman.3640.1345623177.4697.python-list@python.org>
On 21/08/2012 22:51, Dan Stromberg wrote:
> I know I've seen this discussed before, and I came away from observing the
> discussion thinking "Python doesn't do that very well...", but we have some
> people here who really would like to do this, and I need to better
> understand the pros and cons now.
>
> Is there a good way of reimporting an _independent_ set of CPython modules?
>
> I'm aware of these issues:
> http://stackoverflow.com/questions/1254370/reimport-a-module-in-python-while-interactive
> http://docs.python.org/library/functions.html#reload
>
> Are there more?<http://stackoverflow.com/questions/1254370/reimport-a-module-in-python-while-interactive>
>
> Does sandboxing Python code help in some way?  If yes, then what kind of
> sandbox?  Note that this isn't sandboxing to prevent execution of malicious
> code, it's sandboxing to preserve reimportability, which may be an easier
> constraint to satisfy.  The modules are friendly to each other, they aren't
> trying to break into each other, we just have to be careful that they don't
> step on each other's ability to reimport accidentally.
>
> Although I love Pypy, I don't think we'll be able to use Pypy sandboxes
> this time around.
>
> Also, if we need to reload 3 modules at once, can reload() reimport them
> atomically, as a set?  Or would it need to do them one at a time?
>
> In short, we're talking about having some code that allows automatically
> re-importing changed modules.  These modules will be pretty independent of
> each other in the Python world, but might interact with each other in the
> REST world even though they're written in CPython.
>
> Thanks!
>
>
>

As there are no other replies, and my apologies if I'm teaching granny 
to suck eggs, but there are a load of threads on python-dev discussing 
sandboxing.  Whether there are any tie ins with importing is for me not 
to know and for you to find out :) I'll also wonder out loud if the 
reworking of the import mechanism for 3.3 has any impact at all on your 
question.

-- 
Cheers.

Mark Lawrence.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web