This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients amaury.forgeotdarc, belopolsky, eryksun, meador.inge, sobolevn, zach.ware
Date 2022-01-30.17:14:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643562873.16.0.504226870834.issue46585@roundup.psfhosted.org>
In-reply-to
Content
Alternatively, one can cast the address to py_object and dereference its `value`. For example:

    >>> obj = bytearray(b'spam')
    >>> sys.getrefcount(obj)
    2
    >>> obj2 = ctypes.cast(id(obj), ctypes.py_object).value
    >>> obj2 is obj
    True
    >>> sys.getrefcount(obj)
    3
    >>> del obj2
    >>> sys.getrefcount(obj)
    2
History
Date User Action Args
2022-01-30 17:14:33eryksunsetrecipients: + eryksun, amaury.forgeotdarc, belopolsky, meador.inge, zach.ware, sobolevn
2022-01-30 17:14:33eryksunsetmessageid: <1643562873.16.0.504226870834.issue46585@roundup.psfhosted.org>
2022-01-30 17:14:33eryksunlinkissue46585 messages
2022-01-30 17:14:33eryksuncreate