Fernando Perez <[EMAIL PROTECTED]> writes:
> So any regexp-matching based approach here is likely to be fairly brittle,
> unless you restrict your tool to the standard python interpreter, and you
> get some guarantee that it will always tag interactive code with
> '<string>'.

Meant to mention for what it's worth. Looks like I'm not the first to use the 
filename == '<string>' test. I note this in the stock pdb.py:

    # To be overridden in derived debuggers
    def defaultFile(self):
        """Produce a reasonable default."""
        filename = self.curframe.f_code.co_filename
        if filename == '<string>' and self.mainpyfile:
            filename = self.mainpyfile
        return filename

I'm not sure under what conditions this equality test normally occurs
though.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to