[Patches] [Patch #102715] Prototype for PEP 230 - warnings

noreply@sourceforge.net noreply@sourceforge.net
Fri, 15 Dec 2000 13:56:45 -0800


Patch #102715 has been updated. 

Project: python
Category: core (C code)
Status: Closed
Submitted by: gvanrossum
Assigned to : gvanrossum
Summary: Prototype for PEP 230 - warnings

Follow-Ups:

Date: 2000-Dec-15 13:56
By: gvanrossum

Comment:
Checking most of this in now, closing the patch.

(We can tweak it and the PEP later.)

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

Date: 2000-Dec-11 10:36
By: gvanrossum

Comment:
Latest version uploaded (the SF glitch seems fixed).

Just for fun, this adds warnings for raising string exceptions and raising class exception that aren't derived from Exception, and it also adds warnings to the functions in the string module and to the strop module.

These need work, but give an indication that this is a useful feature: it caught lots of offenders in the test suite!  (Patches to sre.py and sre_parse.py included.)

Assigning to Barry if he wants to review it.

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

Date: 2000-Dec-11 07:02
By: gvanrossum

Comment:
I have a new version fof warnings.py that fixes a few nits, but there's a problem with SF that prevents me from uploading it.  Mail me.


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

Date: 2000-Dec-10 20:11
By: gvanrossum

Comment:
Assigned to Tim since he's awake.

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

Date: 2000-Dec-10 20:09
By: gvanrossum

Comment:
All the C code is redone, to postpone the import of warnings.py until PyErr_Warn() is actually called.  This should also be more robust in the light of multiple interpreters (no globals are used).  The warning category exceptions are now created as standard exceptions.

The Python code redone for the new situation, and with some of Paul Prescod's suggestions implemented.

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

Date: 2000-Dec-08 14:38
By: gvanrossum

Comment:
Here's a more elaborate version of the patch, that adds the C API.

(The C API imports warnings.py though.)

Note that in contradition to PEP 230, the C routine to issue a warning is called PyErr_Warn(category, message) rather than Py_Warn(message, category).  This is open for discussion.  Since the category is a kind of exception, it seems to make sense to be consistent with the other PyErr_*() functions rather than with the Python warn(message[, category]) function.

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

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102715&group_id=5470