Skip to content

Commit 49550b5

Browse files
committed
In Expr, function call only for Symbols
1 parent 956b396 commit 49550b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,10 @@ def __rmatmul__(self, lhs): return Expr('@', lhs, self)
396396

397397
def __call__(self, *args):
398398
"Call: if 'f' is a Symbol, then f(0) == Expr('f', 0)."
399-
return Expr(self.op, *args)
399+
if self.args:
400+
raise ValueError('can only do a call for a Symbol, not an Expr')
401+
else:
402+
return Expr(self.op, *args)
400403

401404
# Equality and repr
402405
def __eq__(self, other):

0 commit comments

Comments
 (0)