Show off your Python chops and compete with others

Roy Smith roy at
Fri Nov 8 03:18:58 CET 2013

In article <l5hh32$qf4$1 at>, alex23 <wuwei23 at> 

> On 8/11/2013 11:54 AM, Roy Smith wrote:
> > Dead code doesn't count.
> Neither do shifting goalposts.

It's not a shifting goalpost.  My original statement was that:

def foo():
   raise Exception

defines a function which 1) has no explicit return statement and 2) does 
not return None.  I stand by that statement.  There is no possible 
codepath, no possible calling sequence, no possible execution 
environment, which will cause that function to return None.  That fact 
that one particular Python implementation happens to produce unreachable 
bytecode for returning None is meaningless.  Would you say that:

def baz():
   return None
   print "I got here"

is a function which prints "I got here"?

More information about the Python-list mailing list