Graphics/ClassItem.py

changeset 5651
982465f8389c
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
diff -r 4c52f07c186e -r 982465f8389c Graphics/ClassItem.py
--- a/Graphics/ClassItem.py	Wed Mar 22 18:45:15 2017 +0100
+++ b/Graphics/ClassItem.py	Wed Mar 22 18:50:20 2017 +0100
@@ -21,7 +21,7 @@
     """
     Class implementing the class model.
     """
-    def __init__(self, name, methods=[], attributes=[]):
+    def __init__(self, name, methods=None, attributes=None):
         """
         Constructor
         
@@ -33,8 +33,8 @@
         """
         super(ClassModel, self).__init__(name)
         
-        self.methods = methods
-        self.attributes = attributes
+        self.methods = [] if methods is None else methods[:]
+        self.attributes = [] if attributes is None else attributes[:]
     
     def addMethod(self, method):
         """

eric ide

mercurial