• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(2202)  |  Call(1940)  |  Derive(0)  |  Import(262)
getrefcount(object) -> integer

Return the reference count of object.  The count returned is generally
one higher than you might expect, because it includes the (temporary)
reference as an argument to getrefcount().

src/s/c/scipy-HEAD/scipy/weave/examples/vtk_example.py   scipy(Download)
 
    a = vtk.vtkStructuredPoints()
    a.SetOrigin(1.0, 1.0, 1.0)
    print "sys.getrefcount(a) = ", sys.getrefcount(a)
 
    code=r"""
    printf("a->ClassName() == %s\n", a->GetClassName());
    printf("a->GetReferenceCount() == %d\n", a->GetReferenceCount());
    double *origin = a->GetOrigin();
    printf("Origin = %f, %f, %f\n", origin[0], origin[1], origin[2]);
    """
    weave.inline(code, ['a'], include_dirs=inc_dirs, library_dirs=lib_dirs)
 
    print "sys.getrefcount(a) = ", sys.getrefcount(a)

src/s/c/scipy-0.8.0/scipy/weave/examples/vtk_example.py   scipy(Download)
 
    a = vtk.vtkStructuredPoints()
    a.SetOrigin(1.0, 1.0, 1.0)
    print "sys.getrefcount(a) = ", sys.getrefcount(a)
 
    code=r"""
    printf("a->ClassName() == %s\n", a->GetClassName());
    printf("a->GetReferenceCount() == %d\n", a->GetReferenceCount());
    double *origin = a->GetOrigin();
    printf("Origin = %f, %f, %f\n", origin[0], origin[1], origin[2]);
    """
    weave.inline(code, ['a'], include_dirs=inc_dirs, library_dirs=lib_dirs)
 
    print "sys.getrefcount(a) = ", sys.getrefcount(a)

src/s/l/Slipy-Tractograhpy-HEAD/weave-local/examples/vtk_example.py   Slipy-Tractograhpy(Download)
 
    a = vtk.vtkStructuredPoints()
    a.SetOrigin(1.0, 1.0, 1.0)
    print "sys.getrefcount(a) = ", sys.getrefcount(a)
 
    code=r"""
    printf("a->ClassName() == %s\n", a->GetClassName());
    printf("a->GetReferenceCount() == %d\n", a->GetReferenceCount());
    double *origin = a->GetOrigin();
    printf("Origin = %f, %f, %f\n", origin[0], origin[1], origin[2]);
    """
    weave.inline(code, ['a'], include_dirs=inc_dirs, library_dirs=lib_dirs)
 
    print "sys.getrefcount(a) = ", sys.getrefcount(a)

src/a/s/asciiporn-2009.05.01/asciiporn/weave/examples/vtk_example.py   asciiporn(Download)
 
    a = vtk.vtkStructuredPoints()
    a.SetOrigin(1.0, 1.0, 1.0)
    print "sys.getrefcount(a) = ", sys.getrefcount(a)
 
    code=r"""
    printf("a->ClassName() == %s\n", a->GetClassName());
    printf("a->GetReferenceCount() == %d\n", a->GetReferenceCount());
    double *origin = a->GetOrigin();
    printf("Origin = %f, %f, %f\n", origin[0], origin[1], origin[2]);
    """
    weave.inline(code, ['a'], include_dirs=inc_dirs, library_dirs=lib_dirs)
 
    print "sys.getrefcount(a) = ", sys.getrefcount(a)

src/c/l/clearsilver-0.10.1/clearsilver/python/examples/base/who_calls.py   clearsilver(Download)
            o = getattr (m, sym)
            if type(o) is types.ClassType:
                name = "%s:%s" % (modname,o.__name__)
                cnt = sys.getrefcount (o)
                if base:
                    if set_base:
                        base[name] = cnt

src/p/y/pycsdp-HEAD/examples/example.py   pycsdp(Download)
#!/usr/bin/env python
from __future__ import division
import numpy as np
from pycsdp import _csdp
from sys import getrefcount
c1 = np.array([[2.0, 1.0],
               [1.0, 2.0]])

src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/site-packages/win32comext/axdebug/util.py   ironruby(Download)
        print key,
        try:
            ob = unwrap(key)
            print ob, sys.getrefcount(ob)
        except:
            print "<error>"
 

src/d/a/daneel-ai-HEAD/schemepy/schemepy/oldguile/oldguile.py   daneel-ai(Download)
			print "DEL!!", self
 
	a = A()
	print 0, id(a), 'refs', sys.getrefcount(a)
	scm = PythonSMOB.new(a)
	print 1, scm,   'refs', sys.getrefcount(a)
	print 2, scm.type()
	b = scm.fromscheme()
 
	print 3, b
	print 4, a is b
 
	print 5, 'refs', sys.getrefcount(a)
	del b
	gc.collect()
 
	print 6, 'refs', sys.getrefcount(a)
	del a
	gc.collect()
 
	guile.scm_gc()
	guile.scm_gc()
 
	print 9, 'refs', sys.getrefcount(b)
	gc.collect()
 
	del b

src/t/p/tpserver-py-HEAD/schemepy/schemepy/oldguile/oldguile.py   tpserver-py(Download)
			print "DEL!!", self
 
	a = A()
	print 0, id(a), 'refs', sys.getrefcount(a)
	scm = PythonSMOB.new(a)
	print 1, scm,   'refs', sys.getrefcount(a)
	print 2, scm.type()
	b = scm.fromscheme()
 
	print 3, b
	print 4, a is b
 
	print 5, 'refs', sys.getrefcount(a)
	del b
	gc.collect()
 
	print 6, 'refs', sys.getrefcount(a)
	del a
	gc.collect()
 
	guile.scm_gc()
	guile.scm_gc()
 
	print 9, 'refs', sys.getrefcount(b)
	gc.collect()
 
	del b

src/s/c/schemepy-HEAD/schemepy/oldguile/oldguile.py   schemepy(Download)
			print "DEL!!", self
 
	a = A()
	print 0, id(a), 'refs', sys.getrefcount(a)
	scm = PythonSMOB.new(a)
	print 1, scm,   'refs', sys.getrefcount(a)
	print 2, scm.type()
	b = scm.fromscheme()
 
	print 3, b
	print 4, a is b
 
	print 5, 'refs', sys.getrefcount(a)
	del b
	gc.collect()
 
	print 6, 'refs', sys.getrefcount(a)
	del a
	gc.collect()
 
	guile.scm_gc()
	guile.scm_gc()
 
	print 9, 'refs', sys.getrefcount(b)
	gc.collect()
 
	del b

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next