c 20012006 python software foundation barry warsaw contact emailsigpython org base class for mime specializations all mimebase import email policy from email import message class mimebasemessage message this constructor adds a contenttype and a mimeversion header the contenttype header is taken from the maintype and subtype arguments additional parameters for this header are taken from the keyword arguments c 2001 2006 python software foundation barry warsaw contact email sig python org base class for mime specializations base class for mime specializations this constructor adds a content type and a mime version header the content type header is taken from the _maintype and _subtype arguments additional parameters for this header are taken from the keyword arguments
__all__ = ['MIMEBase']

import email.policy

from email import message


class MIMEBase(message.Message):
    

    def __init__(self, _maintype, _subtype, *, policy=None, **_params):
        
        if policy is None:
            policy = email.policy.compat32
        message.Message.__init__(self, policy=policy)
        ctype = '%s/%s' % (_maintype, _subtype)
        self.add_header('Content-Type', ctype, **_params)
        self['MIME-Version'] = '1.0'