
Steven D'Aprano wrote:
Hello Doug, On Thu, Oct 14, 2021 at 03:45:07PM -0000, Doug Swarin wrote:
I believe strong and valid arguments can be made about the use of None being a fundamental flaw in some types of coding Can you elaborate on that? Obviously it is not always appropriate to use None, but I've never seen it called a *fundamental* flaw. I know that the null pointer has been called a billion-dollar mistake, but Python's None is not a null pointer.
I apologize that I may have spoken too strongly here. When I emailed Mr. Dower, he mentioned that he now believes the implementation of these operators would lead people to a style of coding which would lead to the proliferation of None as an exception-less error result and also throughout data structures. My understanding is that his current preference is to focus on functional composition and styles of programming that disallow the use of None. I certainly don't mean to speak for him and I hope he will weigh in with a more detailed explanation of his thoughts and objections, but I personally disagree as a matter of pure practicality. It's just plain useful to be able to easily take non-values and safely deal with them without having to constantly check for None or to catch and inspect exceptions to see if it's a case that can be ignored. I did indeed think about connecting None to the 'billion dollar mistake' but decided against it since as you say None is not a null pointer, and I should have chosen my words a little more carefully when revising my initial post (likely by removing the word 'fundamental'). Doug