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

Method remove_flag

Lib/mailbox.py:448–453  ·  view source on GitHub ↗

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

(self, key, flag: str)

Source from the content-addressed store, hash-verified

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."""
450 if not isinstance(flag, str):
451 raise TypeError(f'flag must be a string: {type(flag)}')
452 if self.get_flags(key):
453 self.set_flags(key, ''.join(set(self.get_flags(key)) - set(flag)))
454
455 def iterkeys(self):
456 """Return an iterator over keys."""

Callers 2

test_remove_flagMethod · 0.45
test_flagsMethod · 0.45

Calls 4

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

Tested by 2

test_remove_flagMethod · 0.36
test_flagsMethod · 0.36