Return a list of weak references to the keys. The references are not guaranteed to be 'live' at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the g
(self)
| 383 | yield value |
| 384 | |
| 385 | def keyrefs(self): |
| 386 | """Return a list of weak references to the keys. |
| 387 | |
| 388 | The references are not guaranteed to be 'live' at the time |
| 389 | they are used, so the result of calling the references needs |
| 390 | to be checked before being used. This can be used to avoid |
| 391 | creating references that will cause the garbage collector to |
| 392 | keep the keys around longer than needed. |
| 393 | |
| 394 | """ |
| 395 | return list(self.data) |
| 396 | |
| 397 | def popitem(self): |
| 398 | while True: |