Хомский Даниил, 530 DataClass 13010
Диана Бочковенкова, 630 группа DataClass 12914
f1def sloter(fields, default):f1def sloter(fields, default):
22
n3    class cls:n3    class gen_class:
4        __slots__ = fields4        __slots__ = fields
55
6        def __init__(self):6        def __init__(self):
n7            for i in self.__slots__:n7            for field in self.__slots__:
8                setattr(self, i, default)8                setattr(self, field, default)
99
10        def __iter__(self):10        def __iter__(self):
n11            for i in self.__slots__:n11            for field in self.__slots__:
12                if hasattr(self, i):12                if hasattr(self, field):
13                    yield getattr(self, i)13                    yield getattr(self, field)
1414
15        def __delattr__(self, field):15        def __delattr__(self, field):
16            if hasattr(self, field):16            if hasattr(self, field):
17                setattr(self, field, default)17                setattr(self, field, default)
t18    return clst18    return gen_class
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op