On Tue, Feb 17, 2009 at 1:18 PM, Shri Borde <[email protected]> wrote:

>So there may still be a perf concern. However, since I am speculating at this 
>point, I will revert to saying >that the simpler solution should be tried 
>first (which you have), and worry about perf only when there is >specific data.
>

Why not encapsulate the functionality into a simple function call:

def getsrcfile():
    global getsrcfile
    try:
        return sys._getframe(2).yaddayadda
    except ValueError:
        getsrcfile = lambda: None
        return None

Please correct me if I'm wrong, but that should eliminate the perf concern?

(Note: I haven't actually looked at the logging module code)

-Dan
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to