#! /usr/bin/env python2

"""
   some of the mobility code bugs me when they use list comprehension when they really just want to do a loop:

     [ foo() for foo in foo_list ]

   Q: what if the method has no return value?
   A: the method behaves as if it returned `None`
"""

def test(fun):
  try:
    l = [ fun() ]
  except Exception as e:
    print 'Caught: {e!r}'.format(**locals())
  else:
   print 'success: {l}'.format(**locals())

def fun_no_return():
  print 'Welcome to fun_no_return()'

def fun_return_none():
  print 'Welcome to fun_return_none()'
  return None

test(fun_no_return)
test(fun_return_none)
