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