Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to Geoff Bache to exclaim: > > > Unfortunately, it doesn't seem to do that in some cases. Consider the > > > > > following code: > > It does behave as documented: it does not find package names, or > > investigate sys.modules > > Possibly, although for me

Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Geoff Bache
> > Unfortunately, it doesn't seem to do that in some cases. Consider the > > following code: > > It does behave as documented: it does not find package names, or investigate > sys.modules Possibly, although for me "logging" is exposed as a module, and ought to behave as one when requesting the m

Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to Geoff Bache to exclaim: > Hi all, > > I'm trying to examine some things in my stack. The information I get > out of inspect.stack() gives file names and I would like to convert > them to module names. I naturally assumes inspect.getmodulename would > fix

inspect.getmodulename giving unexpected results

2010-09-24 Thread Geoff Bache
Hi all, I'm trying to examine some things in my stack. The information I get out of inspect.stack() gives file names and I would like to convert them to module names. I naturally assumes inspect.getmodulename would fix this for me. Unfortunately, it doesn't seem to do that in some cases. Consider