classification
Title: warnings in interactive sessions
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, lemburg
Priority: normal Keywords:

Created on 2006-08-14 11:03 by lemburg, last changed 2010-07-10 06:28 by terry.reedy.

Messages (2)
msg60969 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2006-08-14 11:03
Carried over from Patch #1538956 description:

During testing I found that the warning registry
defaults to only issueing warnings once per module and
line number. 

I suppose this is enough for debugging code, but it
feels weird when trying things in the interactive
session, as you only get the warnings once in that
context (and for the whole session), regardless of the
fact that you're entering new lines of code all the time.

The reason is that the warning framework registers
warnings based on line number which usually is 1 in
interactive sessions.

In general, it might be a better idea to have a single
global warning registry and then include the module
name or id in the registry key. Currently, the warning
framework creates a new registry per (module) context.
msg85079 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-04-01 19:14
Not a bad idea, although it would require some work to make it work in a
backwards-compatible fashion.
History
Date User Action Args
2010-07-10 06:28:52terry.reedysetversions: + Python 3.2, - Python 2.6
2009-04-01 19:14:14brett.cannonsetassignee: brett.cannon ->
messages: + msg85079
2009-02-11 03:08:20ajaksu2setassignee: brett.cannon
type: enhancement
nosy: + brett.cannon
2006-08-14 11:03:41lemburgcreate