MCPcopy Index your code
hub / github.com/python/cpython / add_label

Method add_label

Lib/mailbox.py:1925–1931  ·  view source on GitHub ↗

Add label to list of labels on the message.

(self, label)

Source from the content-addressed store, hash-verified

1923 self._labels = list(labels)
1924
1925 def add_label(self, label):
1926 """Add label to list of labels on the message."""
1927 if isinstance(label, str):
1928 if label not in self._labels:
1929 self._labels.append(label)
1930 else:
1931 raise TypeError('label must be a string: %s' % type(label))
1932
1933 def remove_label(self, label):
1934 """Remove label from the list of labels on the message."""

Callers 10

test_labelsMethod · 0.95
test_labelsMethod · 0.95
test_babyl_to_maildirMethod · 0.95
test_babyl_to_mhMethod · 0.95
test_babyl_to_babylMethod · 0.95
_explain_toMethod · 0.80
_explain_toMethod · 0.80
_explain_toMethod · 0.80
_explain_toMethod · 0.80

Calls 1

appendMethod · 0.45

Tested by 6

test_labelsMethod · 0.76
test_labelsMethod · 0.76
test_babyl_to_maildirMethod · 0.76
test_babyl_to_mhMethod · 0.76
test_babyl_to_babylMethod · 0.76