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

noreply@sourceforge.net noreply@sourceforge.net
Sun, 10 Dec 2000 20:11:00 -0800


Patch #102715 has been updated. 

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

Follow-Ups:

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