[code.view]

[top] / python / PyMOTW / sys / sys_getrefcount.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2009 Doug Hellmann All rights reserved.
     #
     """
     """
     #end_pymotw_header
     
     import sys
     
     one = []
     print 'At start         :', sys.getrefcount(one)
     
     two = one
     
     print 'Second reference :', sys.getrefcount(one)
     
     del two
     
     print 'After del        :', sys.getrefcount(one)
     

[top] / python / PyMOTW / sys / sys_getrefcount.py

contact | logmethods.com