On 8/3/06, John Salerno <[EMAIL PROTECTED]> wrote:
> According to Python in a Nutshell, references are stored in the
> dictionary sys.modules, but I'm not sure if it matters that it's not
> __modules__ instead (unless that also exists).
Right you are - it's sys.modules, not sys.__modules__.
--
C
Simon Brunning wrote:
> but for the fact that Python
> stashes a reference to the module in (IIRC) sys.__modules__. And you
> mess with *that* at your peril. ;-)
According to Python in a Nutshell, references are stored in the
dictionary sys.modules, but I'm not sure if it matters that it's not
Gerhard Fiedler wrote:
> On 2006-08-03 09:26:54, Simon Brunning wrote:
>
>>> import amodule
>>> amodule.afunction() # Works fine
>>>
>>> del amodule
>>> amodule.afunction() # Will die now
>>
>> Note that this doesn't get rid of a module entirely. Python will
>> still holds on to the module, and
On 8/3/06, Gerhard Fiedler <[EMAIL PROTECTED]> wrote:
> Is that guaranteed, or is that just until the garbage collector has removed
> the module (at some arbitrary point)?
I *think* it's guaranteed.
It's not a matter for the garbage collector. GC only exists to remove
cyclic references. Ordinary
On 2006-08-03 09:26:54, Simon Brunning wrote:
>> import amodule
>> amodule.afunction() # Works fine
>>
>> del amodule
>> amodule.afunction() # Will die now
>
> Note that this doesn't get rid of a module entirely. Python will still
> holds on to the module, and if you just import it again at this
On 8/3/06, Simon Brunning <[EMAIL PROTECTED]> wrote:
> If you want to remove the module from a namespace into which you
> imported it, you can do that with del:
>
> import amodule
> amodule.afunction() # Works fine
>
> del amodule
> amodule.afunction() # Will die now
Note that this doesn't get rid
[EMAIL PROTECTED] wrote:
> Hi
> I am new to python. I wanted to know if there is an opposite of "import"
>
If you mean 'import' adds something, so you ask how to get rid of
something? Here you are:
Look at the 'del' statement if it is what you ar
On 3 Aug 2006 04:50:35 -0700, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi
> I am new to python. I wanted to know if there is an opposite of "import"
Err, depends upon what you mean by opposite.
If you want to remove the module from a namespace into which you
import
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I am new to python. I wanted to know if there is an opposite of "import"
What do you mean? What are you trying to accomplish?
--
Lawrence - http://www.oluyede.org/blog
"Nothing is more dangerous than an idea
if it's
Hi
I am new to python. I wanted to know if there is an opposite of "import"
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo