. Python 2.1 function attributes

Tim Peters tim.one at home.com
Thu Feb 1 23:43:16 EST 2001


[Donn Cave, stderr's best buddy]
> ...
> Since stderr is line buffered, it's really much better to go
> there with diagnostic outputs, in fact that's what it's for and
> why it works the way it does.

Maybe on your OS this is helpful.  On mine output to stderr scrolls off the
shell window irretrievably, and can't be redirected from the command line.
Not much fun to see it interleaved in seemingly random order with stdout
either.

> Likewise, the one line in test_*.py should be about every
> instance of print in any such file.

Sorry, this one's wrong independent of OS.  Python's std regression tests
(test_*.py) work by capturing stdout and comparing it to canned "expected
output" files.  stderr *may* have a marginal role there, but only for
exceedingly rare "what the f**k?!  this isn't just wrong, it's an utterly
unexpected disaster!" cases.  But even those would be better directed to
stdout, because the stdout comparison mechanism would point them out if they
happen, and won't forget to look for them.  People do forget, and, as is,
when one of these stderr cases crops up, regrtest.py doesn't realize the
test failed either.

and-no-i-had-no-part-in-writing-regrtest.py<wink>-ly y'rs  - tim





More information about the Python-list mailing list