n | def sloter(fields, default): | n | def sloter(iters, val): |
| | | |
n | class slo: | n | class Class: |
| __slots__ = fields | | __slots__ = iters |
| | | |
| def __init__(self): | | def __init__(self): |
n | for name in self.__slots__: | n | for slot in Class.__slots__: |
| setattr(self, name, default) | | setattr(self, slot, val) |
| | | |
| def __iter__(self): | | def __iter__(self): |
n | for name in self.__slots__: | n | for slot in Class.__slots__: |
| yield getattr(self, name) | | yield getattr(self, slot) |
| | | |
t | def __delattr__(self, name): | t | def __delattr__(self, slot): |
| setattr(self, name, default) | | setattr(self, slot, val) |
| return slo | | return Class |