refcount differences in 2.5

G

Gabriel Genellina

Hi

With Python 2.5, there is a change on the reference count of objects
compared with previous versions (as reported by sys.getrefcount).

All Python versions from 2.1 thru 2.4 gave these same results:

Python 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
But Python 2.5 (2.5.1 not tested yet) gives different results:
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
on win
32
In particular, I wonder why getrefcount(12341234) returns 3 instead of 2 -
who is holding the extra reference?

My main two concerns are:
- is there a reference leak somewhere?
- it's a bit harder to debug my own references since I don't know
beforehand the value I should expect from sys.getrefcount()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top