Actually, the code will be come

    from contextlib import contextmanager

    @contextmanager
    def managed_store():
        try:
            store = Store(create_database(config['db']))
            yield store
        finally:
            store.close()

, which is not really easier to read. Let's not use it.