config: Change remove() to discard() to allow overriding value using simple attributes.
This commit is contained in:
@ -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())
|
||||||
|
|||||||
Reference in New Issue
Block a user