Removed mutable arguments

This patch remves the set() mutable argument as default value,
sets the default value to None and check if the argument is none
in the code to call set().
This commit is contained in:
Rodolfo García Peñas (kix)
2020-10-10 15:00:34 +02:00
parent fb909671c8
commit 7ff65be690
5 changed files with 20 additions and 5 deletions

View File

@ -133,12 +133,15 @@ class GmailMaildirFolder(MaildirFolder):
self.messagelist[uid]['labels'] = labels
return ret
def savemessagelabels(self, uid, labels, ignorelabels=set()):
def savemessagelabels(self, uid, labels, ignorelabels=None):
"""Change a message's labels to `labels`.
Note that this function does not check against dryrun settings,
so you need to ensure that it is never called in a dryrun mode."""
if ignorelabels is None:
ignorelabels = set()
filename = self.messagelist[uid]['filename']
filepath = os.path.join(self.getfullname(), filename)