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