The Samurai Principle

Robert Kern robert.kern at gmail.com
Fri Sep 10 18:38:45 EDT 2010


On 9/10/10 5:17 PM, Lawrence D'Oliveiro wrote:
> In message<mailman.567.1283927599.29448.python-list at python.org>, Ian Kelly
> wrote:
>
>> And returning None on failure is dangerous, because if the programmer
>> does not take care to handle that case, the program may attempt to
>> regard it as actual data.
>
> But None *is* actual data.

And that is exactly the reason why the Samurai Principle says to not return None 
when the function fails to do what it intended to do.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list