View source on GitHub |
Attachment object.
Inherits From: expected_type
google.appengine.api.mail.Attachment(
filename, payload, content_id=None
)
An Attachment object is largely interchangeable with a (filename, payload)
tuple.
Note:
The behavior is a bit asymmetric with respect to unpacking and equality
comparison. An Attachment object without a content ID will be equivalent
to a (filename, payload)
tuple. An Attachment with a content ID will
unpack to a (filename, payload)
tuple, but will compare unequally to
that tuple.
Thus, the following comparison will succeed:
attachment = mail.Attachment('foo.jpg', 'data')
filename, payload = attachment
attachment == filename, payload
...while the following will fail:
attachment = mail.Attachment('foo.jpg', 'data', content_id='<foo>')
filename, payload = attachment
attachment == filename, payload
The following comparison will pass:
attachment = mail.Attachment('foo.jpg', 'data', content_id='
Arguments | |
---|---|
filename
|
The name of the attachment. |
payload
|
The attachment data. |
content_id
|
Optional; the content ID for this attachment. |
Attributes | |
---|---|
filename
|
The name of the attachment. |
payload
|
The attachment data. |
content_id
|
Optional; the content ID for this attachment. Keyword only. |
Methods
__contains__
__contains__(
val
)
__eq__
__eq__(
other
)
Return self==value.
__getitem__
__getitem__(
i
)
__iter__
__iter__()
__len__
__len__()
__ne__
__ne__(
other
)
Return self!=value.