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