Based on feedback here, I have a slightly revised proposal. Scott makes the
point that if the file parameter passed in to showwarning is not None, the
caller may be trying to extract output formatting. So, it's not enough just to
assign warnings.showwarning = logging.showwarning, since access to th
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Nick Coghlan wrote:
> Antoine Pitrou wrote:
>> Brett Cannon python.org> writes:
>>> It is specifically there to be overridden (and as an aside, it was a
>>> pain to support in the C port of warnings), so it really isn't
>>> monkey-patching. =)
>> Shou
Antoine Pitrou wrote:
> Brett Cannon python.org> writes:
>> It is specifically there to be overridden (and as an aside, it was a
>> pain to support in the C port of warnings), so it really isn't
>> monkey-patching. =)
>
> Should we coin a new word for this? Pretty-patching?
When the module docs
Brett Cannon python.org> writes:
>
> It is specifically there to be overridden (and as an aside, it was a
> pain to support in the C port of warnings), so it really isn't
> monkey-patching. =)
Should we coin a new word for this? Pretty-patching?
cheers
Antoine.
__
On Sat, Nov 22, 2008 at 17:53, Vinay Sajip <[EMAIL PROTECTED]> wrote:
> Sidnei da Silva enfoldsystems.com> writes:
>
>> I do have one suggestion for improvement: instead of requiring the
>> person to do this monkey patching, add a new 'log' action to the
>> warnings filter as described by PEP 230
Sidnei da Silva enfoldsystems.com> writes:
> I do have one suggestion for improvement: instead of requiring the
> person to do this monkey patching, add a new 'log' action to the
> warnings filter as described by PEP 230 [1] (see: 'The Warnings
> Filter' section). This way, changing the behavior
Scott David Daniels wrote:
>
> Match the new warning protocol exactly:
> def showwarning(message, category, filename, lineno,
> file=None, line=None):
> ...
> If the line is not None, use it (which will happen if you pass it
> along to showwarning).
> If
Vinay Sajip wrote:
Brett Cannon has suggested [1] that the logging package should provide an
implementation of warnings.showwarning which redirects to logging. Here are my
first thoughts about how this might work:
A new function, showwarning( message, category, filename, lineno[, file]) will
be
On Sat, Nov 22, 2008 at 9:12 AM, Vinay Sajip <[EMAIL PROTECTED]> wrote:
> Brett Cannon has suggested [1] that the logging package should provide an
> implementation of warnings.showwarning which redirects to logging. Here are my
> first thoughts about how this might work:
>
> A new function, showwa
On Sat, Nov 22, 2008 at 03:12, Vinay Sajip <[EMAIL PROTECTED]> wrote:
> Brett Cannon has suggested [1] that the logging package should provide an
> implementation of warnings.showwarning which redirects to logging. Here are my
> first thoughts about how this might work:
>
> A new function, showwarn
Brett Cannon has suggested [1] that the logging package should provide an
implementation of warnings.showwarning which redirects to logging. Here are my
first thoughts about how this might work:
A new function, showwarning( message, category, filename, lineno[, file]) will
be added to the logging
11 matches
Mail list logo