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

Method add_flag

Lib/mailbox.py:441–446  ·  view source on GitHub ↗

Set the given flag(s) without changing others on the keyed message.

(self, key, flag: str)

Source from the content-addressed store, hash-verified

439 self.set_info(key, '2,' + ''.join(sorted(set(flags))))
440
441 def add_flag(self, key, flag: str):
442 """Set the given flag(s) without changing others on the keyed message."""
443 if not isinstance(flag, str):
444 raise TypeError(f'flag must be a string: {type(flag)}')
445 # TODO: check that flag is a valid standard flag character?
446 self.set_flags(key, ''.join(set(self.get_flags(key)) | set(flag)))
447
448 def remove_flag(self, key, flag: str):
449 """Unset the given string flag(s) without changing others on the keyed message."""

Callers 6

_explain_toMethod · 0.45
_explain_toMethod · 0.45
_explain_toMethod · 0.45
_explain_toMethod · 0.45
test_add_flagMethod · 0.45
test_flagsMethod · 0.45

Calls 4

set_flagsMethod · 0.95
get_flagsMethod · 0.95
setFunction · 0.85
joinMethod · 0.45

Tested by 2

test_add_flagMethod · 0.36
test_flagsMethod · 0.36