Reason why co_filename is no longer interned?

Chris Rebert clp2 at rebertia.com
Mon Mar 2 02:15:52 CET 2009


On Sun, Mar 1, 2009 at 5:03 PM, David Christian
<david.christian at gmail.com> wrote:
> 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
> <function>.func_code.co_filename == <function1>.func_code.co_filename

Are you sure you don't instead mean `is` rather than == ?

Cheers,
Chris

-- 
Shameless self-promotion:
http://blog.rebertia.com



More information about the Python-list mailing list