()
| 76 | weird = Weird() |
| 77 | |
| 78 | def evil(): |
| 79 | gc.freeze() |
| 80 | |
| 81 | # Decrement the reference count from this thread, which will trigger the |
| 82 | # slow path during resurrection and add our weird object to the BRC queue. |
| 83 | nonlocal weird |
| 84 | del weird |
| 85 | |
| 86 | # Collection will merge the object's reference count and make it zero. |
| 87 | gc.collect() |
| 88 | |
| 89 | # Unfreeze the object, making it visible to the GC. |
| 90 | gc.unfreeze() |
| 91 | gc.collect() |
| 92 | |
| 93 | thread = Thread(target=evil) |
| 94 | thread.start() |