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