Казантаев Алексей 619/2 MetaBool 16804 | Чэнь Сюаньдун, 619/2 группа MetaBool 17083 | ||||
---|---|---|---|---|---|
f | 1 | class empty(type): | f | 1 | class empty(type): |
2 | 2 | ||||
3 | def __call__(cls, *args, **kwargs): | 3 | def __call__(cls, *args, **kwargs): | ||
t | 4 | obj = super().__call__(*args, **kwargs) | t | 4 | instance = super().__call__(*args, **kwargs) |
5 | obj.__class__.__bool__ = lambda self: all((bool(v) for v in self.__dict__.values())) | 5 | instance.__class__.__bool__ = lambda self: all((bool(value) for value in self.__dict__.values())) | ||
6 | return obj | 6 | return instance |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|