GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing mail.python.org — [Python-Dev] Warning Framework (PEP 230) [Python-Dev] Warning Framework (PEP 230)Guido van Rossum [email protected]Mon, 11 Dec 2000 13:16:58 -0500
> > > How about returning 1 for 'warning turned into exception' and -1 for 'normal > > > exception' ? It would be slightly more similar to other functions if '-1' > > > meant 'exception', and it would be easy to put in an if statement -- and > > > still allow C code to ignore the produced error, if it wanted to. > > > Why would you want this? The user clearly said that they wanted the > > exception! > > The difference is that in one case, the user will see the original > warning-turned-exception, and in the other she won't -- the warning will be > lost. At best she'll see (by looking at the traceback) the code intended to > give a warning (that might or might not have been turned into an exception) > and failed. Yes -- this is a standard convention in Python. if there's a bug in code that is used to raise or handle an exception, you get a traceback from that bug. > The warning code might decide to do something aditional to > notify the user of the thing it intended to warn about, which ended up as a > 'real' exception because of something else. Nah. The warning code shouldn't worry about that. If there's a bug in PyErr_Warn(), that should get top priority until it's fixed. --Guido van Rossum (home page: http://www.python.org/~guido/)
|
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |