help with warning formatting

Scott David Daniels Scott.Daniels at Acm.Org
Thu Feb 6 16:19:34 EST 2003


If you know how to fix the docs, submit a rewording
as a doc bug.  At least explain exactly what is confusing.
It really won't cost you all that much time, and that
is how our docs improve.

-Scott David Daniels
Scott.Daniels at Acm.Org

Mike Brown wrote:
> "Peter Hansen" <peter at engcorp.com> wrote
> 
>>[RTFM, essentially]
> 
> 
> Thanks. Before posting, I had looked at the docs and had experimented with
> formatwarning(), but didn't get the results I wanted. However, I think I
> figured it out now. It would have been nice if the docs were more clear
> about how the default output is generated.
> 
> The answer I was looking for was either a simple example, or the explanation
> "The warning module docs don't clearly say this, but the output of warn() is
> governed by a combination of formatwarning(), which by default prepends the
> filename and line number to the message, and showwarning(), which by default
> calls formatwarning() and then appends the offending line from the call
> stack. You can replace these functions with your own by reassigning them."
> 
> 
> 





More information about the Python-list mailing list