Воробьев Егор Александрович, 419/2 (КФ) ExceptionTree 11677
Ищенко Светлана Сергеевна, 316 ExceptionTree 12021
f1class ExceptionTree:f1class ExceptionTree:
22
3    def __init__(self):3    def __init__(self):
n4        self._exceptions = {}n4        self.exceptions = {}
55
n6    def __call__(self, index):n6    def __call__(self, n):
7        if index in self._exceptions:7        if in self.exceptions:
8            return self._exceptions[index]8            return self.exceptions[n]
9        if index == 1:9        if n == 1:
10            base_exception = Exception10            par = Exception
11        else:11        else:
t12            base_exception = self(index // 2)t12            par = self(n // 2)
13        new_exception = type(f'Exception-{index}', (base_exception,), {'13        new_exc = type(f'Exception-{n}', (par,), {'n': n})
>n': index}) 
14        self._exceptions[index] = new_exception14        self.exceptions[n] = new_exc
15        return new_exception15        return new_exc
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op