simplify consistency validation
reorder function (logical order) remove duplicate arity (context, config_bag, option_bag, ...) master cannot have length lower than slave length
This commit is contained in:
@ -165,6 +165,8 @@ class OptionBag:
|
||||
kwargs = {}
|
||||
option_bag = OptionBag()
|
||||
for key in self.__slots__:
|
||||
if key == 'properties' and self.config_bag is undefined:
|
||||
continue
|
||||
setattr(option_bag, key, getattr(self, key))
|
||||
return option_bag
|
||||
|
||||
@ -188,6 +190,9 @@ class ConfigBag:
|
||||
return self.permissives
|
||||
raise KeyError('unknown key {} for ConfigBag'.format(key)) # pragma: no cover
|
||||
|
||||
def remove_warnings(self):
|
||||
self.properties = frozenset(self.properties - {'warnings'})
|
||||
|
||||
def remove_validation(self):
|
||||
self.properties = frozenset(self.properties - {'validator'})
|
||||
|
||||
|
Reference in New Issue
Block a user