@classmethod
def from_file(cls, f, filename='?', namespace=None):
    """
        Initializes the config from a file object ``f``. The file is expected to contain a variable named ``CONFIG``.
        """
    ns = dict(__file__=filename)
    if namespace is not None:
        ns.update(namespace)
    return cls.from_string(f.read(), namespace=namespace)
