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

Method _update_careful

Lib/optparse.py:833–844  ·  view source on GitHub ↗

Update the option values from an arbitrary dictionary, but only use keys from dict that already have a corresponding attribute in self. Any keys in dict without a corresponding attribute are silently ignored.

(self, dict)

Source from the content-addressed store, hash-verified

831 return NotImplemented
832
833 def _update_careful(self, dict):
834 """
835 Update the option values from an arbitrary dictionary, but only
836 use keys from dict that already have a corresponding attribute
837 in self. Any keys in dict without a corresponding attribute
838 are silently ignored.
839 """
840 for attr in dir(self):
841 if attr in dict:
842 dval = dict[attr]
843 if dval is not None:
844 setattr(self, attr, dval)
845
846 def _update_loose(self, dict):
847 """

Callers 1

_updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected