Skip to content

Commit 5a027b1

Browse files
committed
Catch a likely-to-occur user error
1 parent 75a4c6d commit 5a027b1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pyNN/random.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ def _resolve_parameters(self, positional, named):
405405
raise KeyError(errmsg % (available_distributions[self.name], tuple(named.keys())))
406406
return named
407407
elif len(named) == 0:
408+
if isinstance(positional, dict):
409+
raise TypeError("Positional parameters should be a tuple, not a dict")
408410
expected_parameter_names = available_distributions[self.name]
409411
if len(positional) != len(expected_parameter_names):
410412
errmsg = "Incorrect number of parameters for random distribution. For %s received %s"

0 commit comments

Comments
 (0)