We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49fcc99 commit e55393cCopy full SHA for e55393c
1 file changed
WDoc/utils/misc.py
@@ -151,9 +151,15 @@ class DocDict(dict):
151
152
def __check_values__(self, key, value):
153
if key not in self.allowed_keys:
154
- raise Exception(f"Cannot set key '{key}' in a DocDict")
+ raise Exception(
155
+ f"Cannot set key '{key}' in a DocDict. Allowed keys are "
156
+ f"'{','.join(self.allowed_keys)}'"
157
+ )
158
if key in self.allowed_types and value is not None:
- assert isinstance(value, self.allowed_types[key])
159
+ assert isinstance(value, self.allowed_types[key]), (
160
+ f"Type of key {key} should be {self.allowed_types[key]},"
161
+ f"not {type(value)}"
162
163
164
def __init__(self, *args, **kwargs):
165
for arg in args:
0 commit comments