@solve.implementation(for_type=ast.IsInstance)<EOL>def solve_isinstance(expr, vars):
lhs = solve(expr.lhs, vars)<EOL>try:<EOL><INDENT>t = solve(expr.rhs, vars).value<EOL><DEDENT>except errors.EfilterKeyError:<EOL><INDENT>t = None<EOL><DEDENT>if t is None:<EOL><INDENT>raise errors.EfilterTypeError(<EOL>root=expr.rhs, query=expr.source,<EOL>message="<STR_LIT>" % expr.rhs.value)<EOL><DEDENT>if not isinstance(t, type):<EOL><INDENT>raise errors.EfilterTypeError(<EOL>root=expr.rhs, query=expr.source,<EOL>message="<STR_LIT>" % (t,))<EOL><DEDENT>return Result(protocol.implements(lhs.value, t), ())<EOL>
Typecheck whether LHS is type on the RHS.