Диана Бочковенкова, 630 группа DataClass 12914
Пахненко Иван 516 DataClass 12629
f1def sloter(fields, default):f1def sloter(fields, default):
22
n3    class gen_class:n3    class my_class:
4        __slots__ = fields4        __slots__ = fields
55
6        def __init__(self):6        def __init__(self):
n7            for field in self.__slots__:n7            for i in self.__slots__:
8                setattr(self, field, default)8                setattr(self, i, default)
99
10        def __iter__(self):10        def __iter__(self):
n11            for field in self.__slots__:n11            for i in self.__slots__:
12                if hasattr(self, field):12                if hasattr(self, i):
13                    yield getattr(self, field)13                    yield getattr(self, i)
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 gen_classt18    return my_class
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op