cpython: 135aa1c4349d (original) (raw)

--- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -277,6 +277,30 @@ def valid_ident(s): return True +class ConvertingMixin(object):

+

+

+ +

The ConvertingXXX classes are wrappers around standard Python containers,

and they serve to convert any suitable values in the container. The

conversion converts base dicts, lists and tuples to their wrapped

@@ -286,77 +310,37 @@ def valid_ident(s):

Each wrapper should have a configurator attribute holding the actual

configurator to use for conversion.

-class ConvertingDict(dict): +class ConvertingDict(dict, ConvertingMixin): """A converting dictionary wrapper.""" def getitem(self, key): value = dict.getitem(self, key)

def get(self, key, default=None): value = dict.get(self, key, default)

def pop(self, key, default=None): value = dict.pop(self, key, default)

-class ConvertingList(list): +class ConvertingList(list, ConvertingMixin): """A converting list wrapper.""" def getitem(self, key): value = list.getitem(self, key)

def pop(self, idx=-1): value = list.pop(self, idx)

-class ConvertingTuple(tuple): +class ConvertingTuple(tuple, ConvertingMixin): """A converting tuple wrapper.""" def getitem(self, key): value = tuple.getitem(self, key)

class BaseConfigurator(object): """