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