Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
Sorry for the late reply. > Just a question: why we need to check ``if number == 0:``? In the > proposal you asked for None too. What changed? Even if the function is > called with False, will it hurts to keep the default value? Fair question. On rethinking, I'm okay with an explicit check for None or zero, ``if number is None or number < 0`` but I don't like the idea of accepting *any* falsey value. Calling the function with False is fine, since False == 0 but I don't think it is fine to call the function with (say) [] or {} or "", which are all falsey values. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36461> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com