Skip to content
Permalink
Browse files
fix: avoid mutable default argument (#1330)
  • Loading branch information
kazanzhy committed Feb 5, 2022
1 parent 1fc6f7b commit 978cc9327ce7deb517ad609977e1ce432c58c5e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
@@ -61,10 +61,10 @@ def lints(self):


class Lint:
def __init__(self, title, body, links=[]):
def __init__(self, title, body, links=None):
self.title = title
self.body = body
self.links = links
self.links = links or []

def __str__(self):
width, _ = shutil.get_terminal_size()
@@ -597,9 +597,12 @@ def job_error():
self.last_msg_was_job_info = False


def format_dict(dict_like, omit_keys=[], omit_values=[]):
def format_dict(dict_like, omit_keys=None, omit_values=None):
from snakemake.io import Namedlist

omit_keys = omit_keys or []
omit_values = omit_values or []

if isinstance(dict_like, Namedlist):
items = dict_like.items()
elif isinstance(dict_like, dict):

0 comments on commit 978cc93

Please sign in to comment.