Sha256: be8564bd8e5b9317af6d11a9c2f6c4558b6096c1a49306db89aae66af86fc1ca
Contents?: true
Size: 596 Bytes
Versions: 71
Compression:
Stored size: 596 Bytes
Contents
from json import dumps class Tree(object): def __init__(self, label, children=[]): self.label = label self.children = children def __dict__(self): return {self.label: [c.__dict__() for c in sorted(self.children)]} def __str__(self, indent=None): return dumps(self.__dict__(), indent=indent) def __lt__(self, other): return self.label < other.label def __eq__(self, other): return self.__dict__() == other.__dict__() def from_pov(self, from_node): pass def path_to(self, from_node, to_node): pass
Version data entries
71 entries across 71 versions & 1 rubygems