On 8/22/2011 11:51 AM, Matthew Brett wrote:
Hi,
I recently ran into this behavior:
import sys import apkg.subpkg del sys.modules['apkg'] import
apkg.subpkg as subpkg
Traceback (most recent call last): File "", line 1,
in AttributeError: 'module' object has no attribute 'subpkg'
where 'apkg'
On Mon, Aug 22, 2011 at 12:14 PM, Matthew Brett wrote:
> Yes, sorry, I should have mentioned that I explored these kind of
> variations.
>
> I think I see that there isn't an obvious way for del sys.modules['apkg']
> to know to delete or modify 'apkg.subpkg', because sys.modules is just a
> dict.
On Monday, August 22, 2011 12:06:44 PM UTC-7, Stephen Hansen wrote:
> On 8/22/11 11:51 AM, Matthew Brett wrote:
> > Hi,
> >
> > I recently ran into this behavior:
> >
> import sys
> import apkg.subpkg
> del sys.modules['apkg']
> import apkg.subpkg as subpkg
> > Traceback (most
On 8/22/11 11:51 AM, Matthew Brett wrote:
> Hi,
>
> I recently ran into this behavior:
>
import sys
import apkg.subpkg
del sys.modules['apkg']
import apkg.subpkg as subpkg
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: 'module' object has no at
Hi,
I recently ran into this behavior:
>>> import sys
>>> import apkg.subpkg
>>> del sys.modules['apkg']
>>> import apkg.subpkg as subpkg
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'subpkg'
where 'apkg' and 'subpkg' comprise empty _