def makeTodo(value):
 if isinstance(value, str):
  return Todo(reason=value)
 if isinstance(value, tuple):
  (errors, reason) = value
  try:
   errors = list(errors)
  except TypeError:
   errors = [errors]
  return Todo(reason=reason, errors=errors)

def makeTodo ( value ) : if isinstance ( value , str ) : return Todo ( reason = value ) if isinstance ( value , tuple ) : ( errors , reason ) = value try : errors = list ( errors ) except TypeError : errors = [ errors ] return Todo ( reason = reason , errors = errors )
return a l{todo} object built from c{value} .