def gen_graph_from_text(cls, file):
    self = cls()
file = open(file, 'r')
for line in file:
    origin = line[0]
destinations = line[1:-1]
self.add_node(origin)
for destination in destinations:
    self.add_node(destination)
edge = Edge(origin, destination)
self.add_connection(edge)
return self
Alternative Constructors in Python