Кузнецов Егор Дмитриевич, ФКИ, 6-ой курс MetaBool 17544 | Островерхов Андрей Сергеевич, 514 группа MetaBool 16701 | ||||
---|---|---|---|---|---|
f | 1 | class empty(type): | f | 1 | class empty(type): |
2 | 2 | ||||
n | 3 | def __call__(cls, *args, **kwds): | n | 3 | def __call__(cls, *args, **kwargs): |
4 | 4 | ||||
n | 5 | def cbool(self): | n | 5 | def __bool__(self): |
6 | for val in self.__dict__.values(): | 6 | for i in self.__dict__.values(): | ||
7 | if not val: | 7 | if not i: | ||
8 | return False | 8 | return False | ||
9 | return True | 9 | return True | ||
t | 10 | cls.__bool__ = cbool | t | 10 | cls.__bool__ = __bool__ |
11 | return super().__call__(*args, **kwds) | 11 | return super().__call__(*args, **kwargs) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|