def value(self, key, type_=None):
if type_ is None:<EOL><INDENT>default = self._default_value(key)<EOL>val = self._value(key, default)<EOL>if type(val) == type(default):<EOL><INDENT>return val<EOL><DEDENT>else:<EOL><INDENT>return self._convert_value(val, type(default))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>val = self._value(key, None)<EOL>if val is None:<EOL><INDENT>return None<EOL><DEDENT>return self._convert_value(val, type_)<EOL><DEDENT>
Get the value of a setting.

        If `type` is not provided, the key must be for a known setting,
        present in `self.default_settings`. Conversely if `type` IS provided,
        the key must be for an unknown setting.