Add responses to Barry's and Fred's concerns. Message matching is now

case insensitive.
This commit is contained in:
Guido van Rossum 2000-12-11 16:50:11 +00:00
parent 600a71428c
commit 0b7cc69207
1 changed files with 24 additions and 5 deletions

View File

@ -180,7 +180,7 @@ The Warnings Filter
the warning category must be a subclass in order to match
- message is a compiled regular expression that the warning
message must match
message must match (the match is case-insensitive)
- module is a compiled regular expression that the module name
must match
@ -264,7 +264,7 @@ Command Line Syntax
- 'message' is a message string; matches warnings whose message
text is an initial substring of 'message' (matching is
case-sensitive)
case-insensitive)
- 'category' is an abbreviation of a standard warning category
class name *or* a fully-qualified name for a user-defined
@ -343,9 +343,9 @@ Open Issues
Rejected Concerns
Paul Prescod has brought up several additional concerns that I
feel aren't critical. I address them here (the concerns are
paraphrased, not necessarily exactly Paul's words).
Paul Prescod, Barry Warsaw and Fred Drake have brought up several
additional concerns that I feel aren't critical. I address them
here (the concerns are paraphrased, not exactly their words):
- Paul: warn() should be a built-in or a statement to make it easily
available.
@ -369,6 +369,25 @@ Rejected Concerns
Response: I don't.
- Barry: It would be nice if lineno can be a range specification.
Response: Too much complexity already.
- Barry: I'd like to add my own warning action. Maybe if `action'
could be a callable as well as a string. Then in my IDE, I
could set that to "mygui.popupWarningsDialog".
Response: For that purpose you would override
warnings.showwarning().
- Fred: why do the Warning category classes have to be in
__builtin__?
Response: that's the simplest implementation, given that the
warning categories must be available in C before the first
PyErr_Warn() call, which imports the warnings module. I see no
problem with making them available as built-ins.
Implementation