Бедрин Павел Александрович, 428 группа ClassOnly 15054 | Валиахметов Булат, 603 группа ClassOnly 14952 | ||||
---|---|---|---|---|---|
f | 1 | from itertools import product | f | 1 | from itertools import product |
n | 2 | slots = set((''.join(t) for t in product('abcd', repeat=4))) | n | 2 | ATTRS = set((''.join(seq) for seq in product('abcd', repeat=4))) |
3 | 3 | ||||
4 | class Struct: | 4 | class Struct: | ||
5 | __slots__ = () | 5 | __slots__ = () | ||
6 | 6 | ||||
t | 7 | def __getattribute__(self, attr): | t | 7 | def __getattribute__(self, item): |
8 | if attr in slots: | 8 | if item in ATTRS: | ||
9 | return attr | 9 | return item | ||
10 | else: | ||||
10 | raise AttributeError | 11 | raise AttributeError |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|