def _expand_typestr(p_type):
 if re.search('\\bor\\b', p_type):
  types = [t.strip() for t in p_type.split('or')]
 elif p_type.startswith('{'):
  p_type = p_type.replace('{', '[').replace('}', ']')
  types = set((type(x).__name__ for x in literal_eval(p_type)))
  types = list(types)
 else:
  types = [p_type]
 return types

def _expand_typestr ( p_type ) : if re . search ( '\\bor\\b' , p_type ) : types = [ t . strip ( ) for t in p_type . split ( 'or' ) ] elif p_type . startswith ( '{' ) : p_type = p_type . replace ( '{' , '[' ) . replace ( '}' , ']' ) types = set ( ( type ( x ) . __name__ for x in literal_eval ( p_type ) ) ) types = list ( types ) else : types = [ p_type ] return types
attempts to interpret the possible types .