def enf_type(field, _type, val):
 try:
  return _type(val)
 except ValueError:
  raise TwitterError({u'message': u'"{0}" must be type {1}'.format(field, _type.__name__)})

def enf_type ( field , _type , val ) : try : return _type ( val ) except ValueError : raise TwitterError ( { u'message' : u'"{0}" must be type {1}' . format ( field , _type . __name__ ) } )
checks to see if a given val for a field is of the proper _type .