Barry A. Warsaw <[EMAIL PROTECTED]> added the comment: I hate to make API suggestions this late in the process, but this is the first time I've looked at this. I think the basic problem is that the context manager API is a bit weird. What I don't like is the fact that __getattr__() indexes the last item in the WarningsRecorder. I don't know the history here, but why wouldn't this be a better API?
with catch_warnings(True) as w: assert len(w) > 0, 'No caught warnings' assert str(w[-1].message) == 'foo', 'blah blah' ---------- nosy: +barry _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3781> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com