@@ -35,49 +35,45 @@ def rule(self, value):
3535 self ._rule = EncodedCDATA (value = value )
3636
3737 @classmethod
38- def from_obj (cls , obj , return_obj = None ):
39- if not obj :
38+ def from_obj (cls , cls_obj ):
39+ if not cls_obj :
4040 return None
41- if not return_obj :
42- return_obj = cls ()
43-
44- super (YaraTestMechanism , cls ).from_obj (obj , return_obj )
45- return_obj .version = obj .Version
46- return_obj .rule = EncodedCDATA .from_obj (obj .Rule )
47-
48- return return_obj
41+
42+ obj = super (YaraTestMechanism , cls ).from_obj (cls_obj )
43+
44+ obj .version = cls_obj .Version
45+ obj .rule = EncodedCDATA .from_obj (cls_obj .Rule )
46+
47+ return obj
4948
50- def to_obj (self , return_obj = None , ns_info = None ):
51- if not return_obj :
52- return_obj = self ._binding_class ()
53-
54- super (YaraTestMechanism , self ).to_obj (return_obj = return_obj , ns_info = ns_info )
49+ def to_obj (self , ns_info = None ):
50+ obj = super (YaraTestMechanism , self ).to_obj (ns_info = ns_info )
5551
5652 if self .version :
57- return_obj .Version = self .version
53+ obj .Version = self .version
5854 if self .rule :
59- return_obj .Rule = self .rule .to_obj (ns_info = ns_info )
55+ obj .Rule = self .rule .to_obj (ns_info = ns_info )
6056
61- return return_obj
57+ return obj
6258
6359 @classmethod
64- def from_dict (cls , d , return_obj = None ):
65- if not d :
60+ def from_dict (cls , cls_dict ):
61+ if not cls_dict :
6662 return None
67- if not return_obj :
68- return_obj = cls ()
69-
70- super (YaraTestMechanism , cls ).from_dict (d , return_obj )
71- return_obj .version = d .get ('version' )
72- return_obj .rule = EncodedCDATA .from_dict (d .get ('rule' ))
63+
64+ obj = super (YaraTestMechanism , cls ).from_dict (cls_dict )
65+
66+ obj .version = cls_dict .get ('version' )
67+ obj .rule = EncodedCDATA .from_dict (cls_dict .get ('rule' ))
7368
74- return return_obj
69+ return obj
7570
7671 def to_dict (self ):
7772 d = super (YaraTestMechanism , self ).to_dict ()
7873
7974 if self .version :
8075 d ['version' ] = self .version
76+
8177 if self .rule :
8278 d ['rule' ] = self .rule .to_dict ()
8379
0 commit comments