f | def sloter(fields, default): | f | def sloter(fields, default): |
| | | |
n | class slo: | n | class klass: |
| __slots__ = fields | | __slots__ = fields |
| | | |
| def __init__(self): | | def __init__(self): |
n | for sl in self.__slots__: | n | for field in klass.__slots__: |
| setattr(self, sl, default) | | setattr(self, field, default) |
| | | |
n | def __delattr__(self, sl): | n | def __delattr__(self, attr): |
| setattr(self, sl, default) | | setattr(self, attr, default) |
| | | |
| def __iter__(self): | | def __iter__(self): |
t | for sl in self.__slots__: | t | for attr in self.__slots__: |
| yield getattr(self, sl) | | yield getattr(self, attr) |
| return slo | | return klass |