MCPcopy Index your code
hub / github.com/python/cpython / _set_attrs

Method _set_attrs

Lib/optparse.py:603–617  ·  view source on GitHub ↗
(self, attrs)

Source from the content-addressed store, hash-verified

601 self._long_opts.append(opt)
602
603 def _set_attrs(self, attrs):
604 for attr in self.ATTRS:
605 if attr in attrs:
606 setattr(self, attr, attrs[attr])
607 del attrs[attr]
608 else:
609 if attr == 'default':
610 setattr(self, attr, NO_DEFAULT)
611 else:
612 setattr(self, attr, None)
613 if attrs:
614 attrs = sorted(attrs.keys())
615 raise OptionError(
616 "invalid keyword arguments: %s" % ", ".join(attrs),
617 self)
618
619
620 # -- Constructor validation methods --------------------------------

Callers 1

__init__Method · 0.95

Calls 3

OptionErrorClass · 0.85
keysMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected