'Used internally by the accessor properties.'

def _get_cache_value(self, key, empty, type):

    if (type is bool):
        return (key in self)
    if (key in self):
        value = self[key]
        if (value is None):
            return empty
        elif (type is not None):
            try:
                value = type(value)
            except ValueError:
                pass
        return value
