. Python 2.1 function attributes

Donn Cave donn at u.washington.edu
Fri Feb 2 12:36:04 EST 2001


Quoth "Tim Peters" <tim.one at home.com>:
| [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.

That is so sad.

|> 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.

You're right, I should have looked at the stuff before saying that.
The "prints" I was really thinking of turn out to be in regrtest.py
itself.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list