(self)
| 22 | self.update(data) |
| 23 | |
| 24 | def __iter__(self): |
| 25 | for itemref in self.data.copy(): |
| 26 | item = itemref() |
| 27 | if item is not None: |
| 28 | # Caveat: the iterator will keep a strong reference to |
| 29 | # `item` until it is resumed or closed. |
| 30 | yield item |
| 31 | |
| 32 | def __len__(self): |
| 33 | return len(self.data) |