Сунь Чжунъао, 622 группа ExceptionTree 11972
Лычева Екатерина Олеговна, 530 ExceptionTree 12013
f1class ExceptionTree:f1class ExceptionTree:
22
3    def __init__(self):3    def __init__(self):
n4        self.cache = {}n4        self.made = {}
55
6    def __call__(self, n):6    def __call__(self, n):
n7        if n in self.cache:n7        if n in self.made:
8            return self.cache[n]8            return self.made[n]
9        if n == 1:9        if n == 1:
n10            exc = type(f'Exception_{n}', (Exception,), {'n': n})n10            cls = type(f'Exception{n}', (Exception,), {'n': n})
11        else:11        else:
12            parent = self(n // 2)12            parent = self(n // 2)
t13            exc = type(f'Exception_{n}', (parent,), {'n': n})t13            cls = type(f'Exception{n}', (parent,), {'n': n})
14        self.cache[n] = exc14        self.made[n] = cls
15        return exc15        return cls
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op