how to call the subclasses within the base_class?
I have problem and need some help towards object oriented
I want to create an graph dataset and some subclasses about modifying the base_graph dataset
my question how to call the subclasses within the base_class in order to remove/add nodes to the base_graph?
class base_graph(Dataset):
    def __init__(self, nodes, edges):
            ---
    def random_graph(self):
            # graph = generate random graph
    def __len__(self):
            ---
    def __repr__(self):
            ---
    def __getitem__(i):
            ---
            how to **call** Modifygraph_byAdding &amp; Modifygraph_byDeleting here 
            # like randomOrder(Modifygraph_byAdding(graph), Modifygraph_byDeleting)



class Modifygraph_byAdding:
        def __init__(self, node):
            ---
        def add_sample_to_A(self, graph):
            ---



class Modifygraph_byDeleting:
        def __init__(self, node):
            ---
        def delete_node_from_A(self, node):
            ---


By &quot;how to call Modifygraph_byAdding &amp; Modifygraph_byDeleting&quot; do you mean to pass instances of those classes, or using them in combination with a user-defined call operator that executes some action?
Either case, you will at least need to provide such instances, either as arguments to __getitem__, or by giving base_graph two new members consisting of these two instances.
That said, I believe your design can be improved by simply noticing that you really don't need two new classes to define what, to me, appears to be functions that act on a specific instance of a base_graph. You could simply do
class base_graph(Dataset):
    def __init__(self, nodes, edges):
        self.nodes = nodes
        self.edges = edges

    def add(self, node):
        # code to add node to self.nodes
   
    def delete(self, node):
        # code to delete node from self.nodes
    
    def random_graph(self):
            # graph = generate random graph
    
    def __len__(self):
            ---

    def __repr__(self):
            ---

    def __getitem__(self, node_i):
            ---
            # here you can use self.add(node_i) and self.delete(node_i)

By the way, are you constructing new base_graphs using random_graph? Depending on how simple this function is, you may just want to stick its implementation inside of the __init__ function and delete def random_graph.
