Show off your Python chops and compete with others

Roy Smith roy at panix.com
Fri Nov 8 02:02:01 CET 2013


In article <pyReu.25286$ql7.11998 at fx33.am4>,
 Alister <alister.ware at ntlworld.com> wrote:

> your sites answer is " defines a function that does nothing"
> once you have defined the function try print (a(1,2,3))
> you will see that is does indeed return none, as do all functions without 
> an explicit return.

Well, if you want to be truly pedantic about it (*), this defines a 
function without an explicit return and which does not return None:

def foo():
   raise Exception

and, for that matter:

def bar():
   import os
   os._exit(0)  # Or variations, such as exec()

(*) and I do.



More information about the Python-list mailing list