Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/test/crashers/weakref_in_del.py

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


import weakref

# http://python.org/sf/1377858
# Fixed for new-style classes in 2.5c1.

ref = None

def test_weakref_in_del():
    class Target():
        def __del__(self):
            global ref
            ref = weakref.ref(self)

    w = Target()

if __name__ == '__main__':
    test_weakref_in_del()

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.