Email and MIME Modules
email.mime.nonmultipart
Base class for legacy MIME leaf parts that reject the attach operation. It prevents accidental conversion of a single part into a multipart container through attach. Use MIMEMultipart for a container or modern EmailMessage composition methods.
Formal Syntax & Structure
python syntaxpython
import email.mime.nonmultipartReturn Value
module
Module namespace available through import; import is a statement, not a value-returning expression.
Working Example
Example Snippetpython
from email.mime.nonmultipart import MIMENonMultipartfrom email.mime.text import MIMETextprint(isinstance(MIMEText("hello"), MIMENonMultipart))