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