How to exit program with custom code and custom message?

Thomas Passin list1 at tompassin.net
Tue Mar 14 00:18:59 EDT 2023


On 3/13/2023 11:50 PM, MRAB wrote:
> 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.

Yes, of course. That's pretty common knowledge.



More information about the Python-list mailing list