Skip to content

Commit 069deea

Browse files
authored
Merge pull request #615 from Mathics3/SetAttribute-arg-check
Add SetAttributes length check and ...
2 parents cdd8e6a + f4eb4ce commit 069deea

File tree

5 files changed

+172
-136
lines changed

5 files changed

+172
-136
lines changed

mathics/builtin/attributes.py

+7
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,13 @@ def eval(self, symbols, attributes, evaluation):
745745
evaluation.message("Attributes", "attnf", Symbol(value))
746746
return SymbolNull
747747

748+
def eval_arg_error(self, args, evaluation):
749+
"SetAttributes[args___]"
750+
# We should only come here when we don't have 2 args, because
751+
# eval() should be called otherwise.
752+
nargs = len(args.elements) if isinstance(args, Expression) else 1
753+
evaluation.message("SetAttributes", "argrx", "SetAttributes", nargs, 2)
754+
748755

749756
class Unprotect(Builtin):
750757
"""

0 commit comments

Comments
 (0)