def register(name):
    """
    Store handler in the `_readline_commands` dictionary.
    """
    assert isinstance(name, six.text_type)
    def decorator(handler):
        assert callable(handler)

        _readline_commands[name] = handler
        return handler
    return decorator