How to exit program with custom code and custom message?

MRAB python at mrabarnett.plus.com
Mon Mar 13 23:50:12 EDT 2023


On 2023-03-14 03:29, Thomas Passin wrote:
> On 3/13/2023 10:34 PM, scruel tao wrote:
>> Lars:
>>> I totally understand your reasoning here, but in some way it
>>> follows the unix philosophy: Do only one thing, but do that good.
> 
>> I understand, python is not strongly typed, so `sys.exit` will be
>> able to accept any types parameters rather than just integer. In
>> order to handle such “other” types logic, I think this function
>> already violated the unix philosophy, and there is no way to avoid
>> it.
> 
> Most Python folks will say the Python *is* fairly strongly typed, but
> for a different definition of "type". That is, duck typing.
> 
It's strongly typed but not statically typed, unless you count type 
hints, which are optional.


More information about the Python-list mailing list