Аксенов Павел Николаевич 530 ExceptionTree 14234
Исанбеков Дамир 414 КФ ExceptionTree 12788
f1class ExceptionTree:f1class ExceptionTree:
22
3    def __init__(self):3    def __init__(self):
n4        self.classes = {}n4        self._cache = {}
55
n6    def __call__(self, n):n6    def __call__(self, index):
7        if n not in self.classes:7        if index not in self._cache:
8            if n == 1:8            if index == 1:
9                base = Exception9                base_exception = Exception
10            else:10            else:
t11                parent_index = n // 2t11                parent_index = index // 2
12                base = self(parent_index)12                base_exception = self(parent_index)
13            new_class = type(f'Exception{n}', (base,), {'n': n})13            exception_class = type(f'Exception{index}', (base_exception,
 >), {'n': index})
14            self.classes[n] = new_class14            self._cache[index] = exception_class
15        return self.classes[n]15        return self._cache[index]
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op