def nonterminals(symbols):
 if (u',' in symbols):
  symbol_list = symbols.split(u',')
 else:
  symbol_list = symbols.split()
 return [Nonterminal(s.strip()) for s in symbol_list]

def nonterminals ( symbols ) : if ( u',' in symbols ) : symbol_list = symbols . split ( u',' ) else : symbol_list = symbols . split ( ) return [ Nonterminal ( s . strip ( ) ) for s in symbol_list ]
given a string containing a list of symbol names .