Graphics/ClassItem.py

changeset 5651
982465f8389c
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
equal deleted inserted replaced
5650:4c52f07c186e 5651:982465f8389c
19 19
20 class ClassModel(UMLModel): 20 class ClassModel(UMLModel):
21 """ 21 """
22 Class implementing the class model. 22 Class implementing the class model.
23 """ 23 """
24 def __init__(self, name, methods=[], attributes=[]): 24 def __init__(self, name, methods=None, attributes=None):
25 """ 25 """
26 Constructor 26 Constructor
27 27
28 @param name the class name (string) 28 @param name the class name (string)
29 @param methods list of method names of the class 29 @param methods list of method names of the class
31 @param attributes list of attribute names of the class 31 @param attributes list of attribute names of the class
32 (list of strings) 32 (list of strings)
33 """ 33 """
34 super(ClassModel, self).__init__(name) 34 super(ClassModel, self).__init__(name)
35 35
36 self.methods = methods 36 self.methods = [] if methods is None else methods[:]
37 self.attributes = attributes 37 self.attributes = [] if attributes is None else attributes[:]
38 38
39 def addMethod(self, method): 39 def addMethod(self, method):
40 """ 40 """
41 Public method to add a method to the class model. 41 Public method to add a method to the class model.
42 42

eric ide

mercurial