def is_terminal(item):
 return (hasattr(item, u'__hash__') and (not isinstance(item, Nonterminal)))

def is_terminal ( item ) : return ( hasattr ( item , u'__hash__' ) and ( not isinstance ( item , Nonterminal ) ) )
return true if the item is a terminal .