[issue11792] asyncore module print to stdout

Samuele Kaplun report at bugs.python.org
Thu Apr 7 14:23:51 CEST 2011


Samuele Kaplun <Samuele.Kaplun at cern.ch> added the comment:

Hi Giampaolo,

shouldn't then the 2nd option I was proposing (i.e. to call warning.warn) the best behavior, given your explanation?

[...]
Warning messages are typically issued in situations where it is useful to alert the user of some condition in a program, where that condition (normally) doesn’t warrant raising an exception and terminating the program. For example, one might want to issue a warning when a program uses an obsolete module.

Python programmers issue warnings by calling the warn() function defined in this module. (C programmers use PyErr_WarnEx(); see Exception Handling for details).
[...]

In this case asyncore might want raise a warning, since the client code of asyncore was expected to handle the event.

If the semantic of log_info is to basically alert the developer is there any particular benefit in printing directly to stdout rather than raising a warning (or simply printing to stderr)?

Ciao!

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11792>
_______________________________________


More information about the Python-bugs-list mailing list