Benjamin wrote: > On Jan 29, 5:46 am, Christian Heimes <[EMAIL PROTECTED]> wrote: >> Simon Pickles wrote: >>> Hi, >>> Is is possible to access the refcount for an object? >>> Ideally, I am looking to see if I have a refcount of 1 before calling del >> Help on built-in function getrefcount in module sys: >> >> getrefcount(...) >> 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(). > Are there any cases when it wouldn't?
Well, as long as the object is named "object" in sys.getrefcount's namespace, there's at least that one reference to it... Mel. -- http://mail.python.org/mailman/listinfo/python-list