I totally understand your reasoning here, but in some way it follows the unix 
philosophy: Do only one thing, but do that good.
And exiting is something different from printing to STDOUT or STDERR. Yes 
sometimes you want to print something before exiting. But then you should do 
that explicitly and to the output you want and not implicitly rely on 
adfdtitional parameters of exit. Yes, not all functions work this way. But that 
does not mean they shouln't ;-)

Cheers

Lars

On 13.03.23 11:18, scruel tao wrote:

Chris:


It doesn't actually take a list of arguments; the square brackets


indicate that arg is optional here.

Oh, I see, it seems that I mistunderstood the document.



but for anything more complicated, just print and then exit.
It's worth noting, by the way, that sys.exit("error message") will
print that to STDERR, not to STDOUT, which mean that the equivalent
is:



Yes, I know, but don’t you think if `sys.exit` can take more parameters and 
have a default output channel selection strategy will be better?
Thanks.





Lars Liedtke
Software Entwickler

[Tel.]  +49 721 98993-
[Fax]   +49 721 98993-
[E-Mail]        l...@solute.de<mailto:l...@solute.de>


solute GmbH
Zeppelinstraße 15
76185 Karlsruhe
Germany


[Logo Solute]


Marken der solute GmbH | brands of solute GmbH
[Marken]
[Advertising Partner]

Geschäftsführer | Managing Director: Dr. Thilo Gans, Bernd Vermaaten
Webseite | www.solute.de <http://www.solute.de/>
Sitz | Registered Office: Karlsruhe
Registergericht | Register Court: Amtsgericht Mannheim
Registernummer | Register No.: HRB 110579
USt-ID | VAT ID: DE234663798



Informationen zum Datenschutz | Information about privacy policy
https://www.solute.de/ger/datenschutz/grundsaetze-der-datenverarbeitung.php



--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to