This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ammar2
Recipients ammar2, mark.dickinson, seberg, serhiy.storchaka, tcaswell, terry.reedy, vstinner
Date 2019-08-30.03:26:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thanks for the insight Terry.

I think the functions that accept ints as bools are kind of a red herring: Booleans were only formally introduced in Python 2.3 [1], thus any functions that existed before that accepted ints and continued to accept ints for backwards compatibility [2]. When transition to argument clinic, these functions use "bool(accept={int})" which restricts the inputs to either bools or ints [3]. 

print, int.to_bytes and int.from_bytes all use argument clinic's bool converter which accepts any truth-y objects. This is similar to PyArg_ParseTuple's 'p' parameter which also accepts any truthy objects as well as say the print function which manually does a PyObject_IsTrue [4].


[2] list.sort (sorted) existed since the start of Python:

splitlines exists in Python 2.0:


Date User Action Args
2019-08-30 03:26:53ammar2setrecipients: + ammar2, terry.reedy, mark.dickinson, vstinner, serhiy.storchaka, seberg, tcaswell
2019-08-30 03:26:53ammar2setmessageid: <>
2019-08-30 03:26:53ammar2linkissue37980 messages
2019-08-30 03:26:53ammar2create