Reason why co_filename is no longer interned?

2009-03-01 Thread David Christian
In 2005, when the ast branch was merged to head, compile.c when setting the filename for the code object, PyString_InternFromString was replaced with PyString_FromString. http://svn.python.org/view?view=rev&revision=39758 This means that where before, you could rely that .func_code.co_filename =

How to tell the parent frame is a C module? (Lazy importing)

2006-02-15 Thread David Christian
Hello all, I've been working on a lazy import module to be found here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473888 The basic idea is that a module proxy for foo is returned from an 'import foo' statement. When an attribute of foo is accessed, or dir(foo) is called, or a from fo