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