diff --git a/pyproject.toml b/pyproject.toml index 73c196e..af4c58f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "random-sets" -version = "0.1.0" +version = "0.1.1" description = "A small library of helper classes for dealing with random data using weighted distributions" authors = ["evilchili "] readme = "README.md" diff --git a/random_sets/datasources.py b/random_sets/datasources.py index 54f56fd..18b1c30 100644 --- a/random_sets/datasources.py +++ b/random_sets/datasources.py @@ -124,7 +124,7 @@ class DataSource: # If there is no data for the specified option, stop now. flattened = [option] if not self.data[option]: - flattened + return random.choice(flattened) if rand else flattened if hasattr(self.data[option], 'keys'): # if the option is a dict, we assume the values are lists; we select a random item