88__gist__ = "<https://gist.github.com/diopib/7679559>"
99
1010
11- class Catalog ():
11+ class Catalog (object ):
12+ """catalog of multiple static methods that are executed depending on an init
1213
13- """
14- catalog of multiple static methods that are executed depending on an init
1514 parameter
1615 """
1716
@@ -38,18 +37,18 @@ def _static_method_2():
3837 print ("executed method 2!" )
3938
4039 def main_method (self ):
41- """
42- will execute either _static_method_1 or _static_method_2
40+ """will execute either _static_method_1 or _static_method_2
41+
4342 depending on self.param value
4443 """
4544 self ._static_method_choices [self .param ]()
4645
4746
4847# Alternative implementation for different levels of methods
49- class CatalogInstance :
48+ class CatalogInstance (object ):
49+
50+ """catalog of multiple methods that are executed depending on an init
5051
51- """
52- catalog of multiple methods that are executed depending on an init
5352 parameter
5453 """
5554
@@ -72,17 +71,17 @@ def _instance_method_2(self):
7271 'param_value_2' : _instance_method_2 }
7372
7473 def main_method (self ):
75- """
76- will execute either _instance_method_1 or _instance_method_2
74+ """will execute either _instance_method_1 or _instance_method_2
75+
7776 depending on self.param value
7877 """
7978 self ._instance_method_choices [self .param ].__get__ (self )()
8079
8180
82- class CatalogClass :
81+ class CatalogClass (object ):
82+
83+ """catalog of multiple class methods that are executed depending on an init
8384
84- """
85- catalog of multiple class methods that are executed depending on an init
8685 parameter
8786 """
8887
@@ -108,17 +107,17 @@ def _class_method_2(cls):
108107 'param_value_2' : _class_method_2 }
109108
110109 def main_method (self ):
111- """
112- will execute either _class_method_1 or _class_method_2
110+ """will execute either _class_method_1 or _class_method_2
111+
113112 depending on self.param value
114113 """
115114 self ._class_method_choices [self .param ].__get__ (None , self .__class__ )()
116115
117116
118- class CatalogStatic :
117+ class CatalogStatic (object ):
118+
119+ """catalog of multiple static methods that are executed depending on an init
119120
120- """
121- catalog of multiple static methods that are executed depending on an init
122121 parameter
123122 """
124123
@@ -141,8 +140,8 @@ def _static_method_2():
141140 'param_value_2' : _static_method_2 }
142141
143142 def main_method (self ):
144- """
145- will execute either _static_method_1 or _static_method_2
143+ """will execute either _static_method_1 or _static_method_2
144+
146145 depending on self.param value
147146 """
148147 self ._static_method_choices [self .param ].__get__ (None , self .__class__ )()
0 commit comments