From 28c6ce97143e9eb02daee9c1e027b07cec2d00c9 Mon Sep 17 00:00:00 2001
From: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Date: Mon, 7 Sep 2020 20:53:59 +0200
Subject: [PATCH] SpecList: remove mutable types from __init__ arguments
 (#18515)

fixes #18439
---
 lib/spack/spack/spec_list.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/spack/spack/spec_list.py b/lib/spack/spack/spec_list.py
index bc473f530c..1aa0ab870e 100644
--- a/lib/spack/spack/spec_list.py
+++ b/lib/spack/spack/spec_list.py
@@ -25,7 +25,11 @@ def spec_ordering_key(s):
 
 class SpecList(object):
 
-    def __init__(self, name='specs', yaml_list=[], reference={}):
+    def __init__(self, name='specs', yaml_list=None, reference=None):
+        # Normalize input arguments
+        yaml_list = yaml_list or []
+        reference = reference or {}
+
         self.name = name
         self._reference = reference  # TODO: Do we need defensive copy here?
 
-- 
GitLab