f | def sloter(fields, default): | f | def sloter(fields, default): |
| | | |
n | class _cls: | n | class Result: |
| __slots__ = fields | | __slots__ = fields |
| | | |
| def __init__(self): | | def __init__(self): |
n | for f in self.__slots__: | n | for i in self.__slots__: |
| setattr(self, f, default) | | setattr(self, i, default) |
| | | |
| def __iter__(self): | | def __iter__(self): |
n | return (getattr(self, item) for item in self.__slots__) | n | return (getattr(self, k) for k in self.__slots__) |
| | | |
| def __delattr__(self, item): | | def __delattr__(self, item): |
| setattr(self, item, default) | | setattr(self, item, default) |
t | return _cls | t | return Result |