def single_char_or_unicode(argument):
 char = unicode_code(argument)
 if (len(char) > 1):
  raise ValueError(('%r invalid; must be a single character or a Unicode code' % char))
 return char

def single_char_or_unicode ( argument ) : char = unicode_code ( argument ) if ( len ( char ) > 1 ) : raise ValueError ( ( '%r invalid; must be a single character or a Unicode code' % char ) ) return char
a single character is returned as-is .