config: Change remove() to discard() to allow overriding value using simple attributes.

This commit is contained in:
Romain Dorgueil
2018-07-12 16:25:26 +02:00
parent 8b3215ad25
commit d9f2fd3009

View File

@ -140,15 +140,14 @@ class Configurable(metaclass=ConfigurableMeta):
break # option orders make all positional options first, job done. break # option orders make all positional options first, job done.
if not isoption(getattr(cls, name)): if not isoption(getattr(cls, name)):
missing.remove(name) missing.discard(name)
continue continue
if len(args) <= position: if len(args) <= position:
break # no more positional arguments given. break # no more positional arguments given.
position += 1 position += 1
if name in missing: missing.discard(name)
missing.remove(name)
# complain if there is more options than possible. # complain if there is more options than possible.
extraneous = set(kwargs.keys()) - (set(next(zip(*options))) if len(options) else set()) extraneous = set(kwargs.keys()) - (set(next(zip(*options))) if len(options) else set())