def _character_check(items, argument_name, function_name):
    """Make sure all elements of `items` are single-character ASCII strings.

  Args:
    items: an iterable of things that should be single-character ASCII strings.
    argument_name: if raising a `TypeError` due to finding an illegal value in
        `items`, a name to give `items` in the exception string.
    function_name: if raising a `TypeError` due to finding an illegal value in
        `items`, a name to give the entity that objects to that value.

  Raises:
    TypeError: if anything that's not a single-character ASCII strings turns up
        in `items`; the exception string will say that `function_name` objects
        to finding such things in `argument_name`.
  """
    for item in items:
        try:
            _ = ord(item)
        except TypeError:
            raise TypeError(
                '{} requires all elements in its {} argument to be single-character ASCII strings, but {} was found inside {}.'
                .format(function_name, argument_name, repr(item),
                argument_name))
