def attempts(number=3):
    """Generate up to *number* (transactional) context managers.

        This method is typically used as follows::

            for attempt in transaction_manager.attempts():
                with attempt:
                    *with block*

        The ``with attempt:`` starts a new transaction for the
        execution of the *with block*. If the execution succeeds, the
        (then current) transaction is commited and the ``for`` loop
        terminates. If the execution raised an exception, then the
        transaction is aborted. If the exception was some kind of
        `retriable error <ITransaction.isRetryableError>` and the
        maximal number of attempts is not yet reached, then a next
        iteration of the ``for`` loop starts. In all other cases,
        the ``for`` loop terminates with the exception.
        """
