[Zope] finding my root

Dieter Maurer dieter at handshake.de
Wed Jun 2 16:55:22 EDT 2004


Chris Withers wrote at 2004-6-1 15:07 +0100:
>Dieter Maurer wrote:
>
>> It is very easy to turn warnings into exceptions and then you
>> will get tracebacks.
>
>Really? How? Oh, don't tell me: Google. Right, okay, can't find it?

Google is not bad, but for this kind of question there is a more
natural place to look at -- the most natural place you can
imagine: the documentation for Python's "warnings" module.

>No suprise 
Surprise: Python comes with documentation ;-)

Look into it when you want to get answers about Python ...

> ...
>> It is also quite easy to hook into the warning system and
>> change the way it works -- should you really need it...
>
>Then why doesn't Zope do this by default?

Probably because it does not feel the need --
neither do I, for example.

>I see no value in having a warning 
>print a one line text message with no context that could come close to even 
>helping you find out what code is triggering the problem.

The one line usually tells you in what module and what
line the warning was issued: e.g.:

>>> warn('abc',DeprecationWarning)
/home/dieter/.pyrc.py:1: DeprecationWarning: abc


This has been enough for all warning I have really cared for.
(I used the warning filter feature to discard most
"DeprecationWarning"s as they usually are abused).

-- 
Dieter



More information about the Zope mailing list