def item_action(item):  # noqa
    """Returns actionnable method for the specified item.

    Args:
        item (any): Any object with a compile method.

    Returns:
        function: An actionnable method.

    """

    def action(self, element=None):
        """Perform an action."""
        self.append(item.compile(element))
        return self
    return action