Литвинов Арсений Александрович ClassOnly 14976 | Полина Рагозина, 527 группа ClassOnly 15548 | ||||
---|---|---|---|---|---|
f | 1 | from itertools import product | f | 1 | from itertools import product |
2 | 2 | ||||
3 | class Struct: | 3 | class Struct: | ||
4 | __slots__ = () | 4 | __slots__ = () | ||
n | 5 | __precomputed_set_of_names = {''.join(name) for name in product('abcd', repeat=4)} | n | 5 | possible = {''.join(i) for i in product('abcd', repeat=4)} |
6 | 6 | ||||
t | 7 | def __getattribute__(self, name): | t | 7 | def __getattribute__(self, item): |
8 | if name in Struct.__precomputed_set_of_names: | 8 | if item in Struct.possible: | ||
9 | return name | 9 | return item | ||
10 | else: | 10 | else: | ||
11 | raise AttributeError | 11 | raise AttributeError |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|