def _getParts(self):
        """
        Return an iterator over all of the sub-messages of this message.
        """
        i = 0
        while True:
            try:
                part = self.message.getSubPart(i)
            except IndexError:
                break
            else:
                yield part
                i += 1

        Return an iterator over all of the sub-messages of this message.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/imap4.py