Skip to content

Commit

Permalink
add error if using 'lambda' as var/parname
Browse files Browse the repository at this point in the history
  • Loading branch information
gboehl committed Dec 21, 2023
1 parent df6e91f commit 8f958f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions econpizza/parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ def load(
_ = _define_subdict_if_absent(model, "func_strings")
_ = _define_subdict_if_absent(model, "steady_state")
par_names = _define_subdict_if_absent(model, "parameters")
if 'lambda' in evars + par_names:
raise NameError(
"Variables or parameters must not use the name of python's build-in functions \"lambda\".")
if isinstance(par_names, dict):
raise TypeError(
f'parameters must be a list and not {type(par_names)}.')
Expand Down

0 comments on commit 8f958f2

Please sign in to comment.