You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would need to carry through to python-stix|cybox|maec. We don't need it except in places where we have extension points.
We have code that passes around a return_obj to handle type inheritance in to/from dict/obj methods.
classFoo(Entity):
_binding_class=some.binding.classnamedefto_obj(self, return_obj=None, ns_info=None):
ifreturn_objisNone:
return_obj=self._binding_class()
return_obj.value=self.valuereturnreturn_objclassDerivedFoo(Foo):
_binding_class=some.other.binding.classnamedefto_obj(self, return_obj=None, ns_info=None):
ifreturn_objisNone:
return_obj=self._binding_class()
# Apply super attributes to the return_obj we created heresuper(DerivedFoo, self).to_obj(return_obj=return_obj, ns_info=ns_info)
# Apply our own attribtes and returnreturn_obj.foo="bar"returnreturn_obj
But it could be replaced with code that makes better use of super().
This would need to carry through to python-stix|cybox|maec. We don't need it except in places where we have extension points.
We have code that passes around a
return_obj
to handle type inheritance in to/from dict/obj methods.But it could be replaced with code that makes better use of
super()
.Most of this would be in python-stix|cybox|maec, but the changes would start in mixbox.
The text was updated successfully, but these errors were encountered: