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

Method configure_custom

Lib/logging/config.py:480–492  ·  view source on GitHub ↗

Configure an object with a user-supplied factory.

(self, config)

Source from the content-addressed store, hash-verified

478 return value
479
480 def configure_custom(self, config):
481 """Configure an object with a user-supplied factory."""
482 c = config.pop('()')
483 if not callable(c):
484 c = self.resolve(c)
485 # Check for valid identifiers
486 kwargs = {k: config[k] for k in config if (k != '.' and valid_ident(k))}
487 result = c(**kwargs)
488 props = config.pop('.', None)
489 if props:
490 for name, value in props.items():
491 setattr(result, name, value)
492 return result
493
494 def as_tuple(self, value):
495 """Utility function which converts lists to tuples."""

Callers 3

configure_formatterMethod · 0.80
configure_filterMethod · 0.80
configure_handlerMethod · 0.80

Calls 5

resolveMethod · 0.95
valid_identFunction · 0.85
cClass · 0.50
popMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected