Даулетбек Досай 404 группа (КФ) NegExtender 12897
Жангирхан Шаку, 404 NegExtender 12980
f1class NegExt:f1class NegExt:
22
3    def __neg__(self):3    def __neg__(self):
n4        cls = self.__class__n4        class_reference = self.__class__
5        for base in cls.__mro__[1:]:5        for ancestor in class_reference.__mro__[1:]:
6            if hasattr(base, '__neg__') and callable(base.__neg__) and (6            if hasattr(ancestor, '__neg__') and callable(ancestor.__neg_
>base is not NegExt):>_) and (ancestor is not NegExt):
7                try:7                try:
n8                    result = base.__neg__(self)n8                    neg_result = ancestor.__neg__(self)
9                    return cls(result)9                    return class_reference(neg_result)
10                except TypeError:10                except TypeError:
11                    continue11                    continue
12        if hasattr(self, '__getitem__'):12        if hasattr(self, '__getitem__'):
13            try:13            try:
n14                sliced = self[1:-1]n14                sliced_part = self[1:-1]
15                return cls(sliced) if not isinstance(self, dict) else cl15                return class_reference(sliced_part) if not isinstance(se
>s(sliced.items())>lf, dict) else class_reference(sliced_part.items())
16            except (TypeError, IndexError, KeyError):16            except (TypeError, IndexError, KeyError):
17                pass17                pass
t18        return cls(self) if not isinstance(self, dict) else cls(self.itet18        return class_reference(self) if not isinstance(self, dict) else 
>ms())>class_reference(self.items())
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op