Воробьев Сергей Юрьевич 530 ExceptionTree 12657
Усович Алексей, 530 группа ExceptionTree 12677
f1class ExceptionTree:f1class ExceptionTree:
22
3    def __init__(self):3    def __init__(self):
n4        self.exception_classes = {}n4        self.idxs = {}
55
n6    def __call__(self, n):n6    def __call__(self, idx):
7        if n not in self.exception_classes:7        if idx not in self.idxs:
8            if n == 1:8            if idx == 1:
9                base = Exception9                parent = Exception
10            else:10            else:
t11                base = self(n // 2)t11                parent = self(idx // 2)
12            cls = type(f'Exception-{n}', (base,), {'n': n})12            node = type(f'Exception-{idx}', (parent,), {'n': idx})
13            self.exception_classes[n] = cls13            self.idxs[idx] = node
14        return self.exception_classes[n]14        return self.idxs[idx]
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op