# Copyright (C) 2001-2006 Python Software Foundation# Author: Barry Warsaw# Contact: email-sig@python.org"""Base class for MIME specializations."""__all__ = ['MIMEBase']import email.policyfrom email import messageclass MIMEBase(message.Message):"""Base class for MIME specializations."""def __init__(self, _maintype, _subtype, *, policy=None, **_params):"""This constructor adds a Content-Type: and a MIME-Version: header.The Content-Type: header is taken from the _maintype and _subtypearguments. Additional parameters for this header are taken from thekeyword arguments."""if policy is None:policy = email.policy.compat32message.Message.__init__(self, policy=policy)ctype = '%s/%s' % (_maintype, _subtype)self.add_header('Content-Type', ctype, **_params)self['MIME-Version'] = '1.0'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。