def rename(oldname, newname):
        """
        Rename a mailbox

        @type oldname: L{bytes}
        @param oldname: The current name of the mailbox to rename.

        @type newname: L{bytes}
        @param newname: The new name to associate with the mailbox.

        @rtype: L{Deferred} or L{bool}
        @return: A true value if the mailbox is successfully renamed, or a
            L{Deferred} whose callback will be invoked when the rename
            operation is completed.

        @raise MailboxException: Raised if this mailbox cannot be renamed. This
            may also be raised asynchronously, if a L{Deferred} is returned.
        """

        Rename a mailbox

        @type oldname: L{bytes}
        @param oldname: The current name of the mailbox to rename.

        @type newname: L{bytes}
        @param newname: The new name to associate with the mailbox.

        @rtype: L{Deferred} or L{bool}
        @return: A true value if the mailbox is successfully renamed, or a
            L{Deferred} whose callback will be invoked when the rename
            operation is completed.

        @raise MailboxException: Raised if this mailbox cannot be renamed. This
            may also be raised asynchronously, if a L{Deferred} is returned.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/interfaces.py