On 2022-01-06 at 14:21:48 -0700, Mats Wichmann <m...@wichmann.us> wrote:
> And at a more meta level: many functions in the Python world return > None as an indication that the operation did not succeed. It's useful > because in many circumstances None is an "out of band" value - one > that could not happen naturally - and thus returning it provides an > easy way for the caller to check for success or failure. Errors should never pass silently. Unless explicitly silenced. https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/ Exceptions aren't perfect, but when something fails, I'd much rather have an exception raised and thrown at me than to get back None. An exception is immediate,¹ but None often ends up causing trouble far away¹ from where the actual failure occurred. ¹ in space and in time -- https://mail.python.org/mailman/listinfo/python-list