def VisitFunction(self, f):
    'Remove all signatures that have a shorter version.\n\n    We use signatures with optional argument (has_opt=True) as template\n    and then match all signatures against those templates, removing those\n    that match.\n\n    Arguments:\n      f: An instance of pytd.Function\n\n    Returns:\n      A potentially simplified instance of pytd.Function.\n    '
    optional_arg_sigs = frozenset((s.params for s in f.signatures if s.has_optional))
    new_signatures = (s for s in f.signatures if (not self._HasShorterVersion(s, optional_arg_sigs)))
    return f.Replace(signatures=tuple(new_signatures))
Remove all signatures that have a shorter version.

We use signatures with optional argument (has_opt=True) as template
and then match all signatures against those templates, removing those
that match.

Arguments:
  f: An instance of pytd.Function

Returns:
  A potentially simplified instance of pytd.Function.
def VisitFunction(self, f):
    'Remove all signatures that have a shorter version.\n\n    We use signatures with optional argument (has_opt=True) as template\n    and then match all signatures against those templates, removing those\n    that match.\n\n    Arguments:\n      f: An instance of pytd.Function\n\n    Returns:\n      A potentially simplified instance of pytd.Function.\n    '
    optional_arg_sigs = frozenset((s.params for s in f.signatures if s.has_optional))
    new_signatures = (s for s in f.signatures if (not self._HasShorterVersion(s, optional_arg_sigs)))
    return f.Replace(signatures=tuple(new_signatures))