Skip to content

Commit 952a034

Browse files
committed
checking if for Range the default is not equal low (this is default set by traits)
1 parent 388009f commit 952a034

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/checkspecs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,13 @@ def test_specs(self, uri):
276276
# also have `usedefault` specified;
277277
# excluding Enum: always has default value (the first value)
278278
# excluding Tuple: takes tuple of inner traits default values as default, but doesn't use it
279+
# for Range assuming that if default == low, it's likely that usedefault should be False
280+
# (for Range traits takes low as a default default
279281
if trait.trait_type.__class__.__name__ not in ["Tuple", "Enum"]\
280282
and trait.default and "usedefault" not in trait.__dict__:
283+
if trait.trait_type.__class__.__name__ is "Range"\
284+
and trait.default == trait.trait_type._low:
285+
continue
281286
bad_specs.append(
282287
[uri, c, 'Inputs', traitname, 'default value is set, no value for usedefault'])
283288

0 commit comments

Comments
 (0)