@staticmethod<EOL><INDENT>def _make_param_matcher(annotation, kind=None):<DEDENT>
if isinstance(annotation, type) or (<EOL>isinstance(annotation, tuple) and<EOL>all(isinstance(a, type) for a in annotation)):<EOL><INDENT>if kind is Parameter.VAR_POSITIONAL:<EOL><INDENT>return (lambda args: all(isinstance(x, annotation) for x in args))<EOL><DEDENT>else:<EOL><INDENT>return (lambda x: isinstance(x, annotation))<EOL><DEDENT><DEDENT>elif callable(annotation):<EOL><INDENT>return annotation<EOL><DEDENT>else:<EOL><INDENT>return (lambda x: x == annotation)<EOL><DEDENT>
For a given annotation, return a function which, when called on a
function argument, returns true if that argument matches the annotation.
If the annotation is a type, it calls isinstance; if it's a callable,
it calls it on the object; otherwise, it performs a value comparison.
If the parameter is variadic (*args) and the annotation is a type, the
matcher will attempt to match each of the arguments in args