2 ms·
Why not just something similar to (forgive the pascal) if isinstance(node, WithStmt) AND (len(node.expr) = 1) AND isinstance(node.expr, CallExpr) AN
by mikewarot 4y ago
Why not just something similar to (forgive the pascal)
if isinstance(node, WithStmt) AND
(len(node.expr) = 1) AND
isinstance(node.expr, CallExpr) AND
isinstance(node.expr.callee,NameExper) AND
(node.expr.callee.name == 'open') then
begin
do stuff here
end;