[Patches] [ python-Patches-504943 ] call warnings.warn with Warning instance

noreply@sourceforge.net noreply@sourceforge.net
Wed, 20 Mar 2002 09:26:04 -0800


Patches item #504943, was opened at 2002-01-17 17:50
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=504943&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Nobody/Anonymous (nobody)
Summary: call warnings.warn with Warning instance

Initial Comment:
This patch makes it possible to pass Warning instances 
as the first argument to warnings.warn. In this case 
the category argument will be ignored. The message
text used will be str(warninginstance). This makes it 
possible to implement special logic in a custom 
Warning class by implemening the __str__ method.


----------------------------------------------------------------------

>Comment By: Walter Dörwald (doerwalter)
Date: 2002-03-20 18:26

Message:
Logged In: YES 
user_id=89016

Now that I have write access can I check this in?

----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2002-03-18 16:46

Message:
Logged In: YES 
user_id=89016

The new version includes a patch to the documentation and 
an entry in Misc/NEWS

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-18 14:45

Message:
Logged In: YES 
user_id=6380

Nice idea. Where's the documentation patch?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=504943&group_id=5470