<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_child(self, child):
 """Adds an object as a child in the scene graph."""

        if not issubclass(child.__class__, SceneGraph):
            raise TypeError("child must have parent/child iteration implemented to be a node in a SceneGraph.")
        # if not hasattr(child, 'update'):
            # raise TypeError("child must have an attribute update()")

        child._parent = self
        self._children.append(child)