Created
September 26, 2025 18:39
-
-
Save koi8-r/7e53afaa4de9e853b0b6af06afe7c37d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import weakref | |
| class A: ... | |
| def test_() -> None: | |
| o = A() | |
| ref = weakref.ref(o) | |
| assert ref() is not None | |
| del o | |
| assert ref() is None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment