darrenr python-roun...@dranalli.com added the comment:
I think we still need to prevent collectable cycles in our Python code.
Here's the situation:
We've got a process that creates many Python objects, and it needs to be
responsive, it's not good for it to block on one operation for more than
darrenr [EMAIL PROTECTED] added the comment:
We've gotten into the habit of writing manual destructors to remove
references like the one you wrote. I think explicit destruction is a
useful paradigm when resource allocation is involved and it's important
to manage the allocation's lifetime
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Closing issue as Not a bug.
(but we can continue the discussion here...)
--
resolution: - works for me
status: open - closed
___
Python tracker [EMAIL PROTECTED]
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
But the garbage collector was invented for this very purpose: to break
cycles! Take the following example which create a cycle for every
instance of the class (the profile module has similar code):
class C:
def __init__(self):
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Where is the problem, if these reference cycles are properly broken by
the garbage collector *unless* you tell it not to?
--
nosy: +amaury.forgeotdarc
___
Python tracker [EMAIL PROTECTED]
darrenr [EMAIL PROTECTED] added the comment:
I work at a development house that has decided to tell gc to keep all
cycles, in order to prevent any cycles from being created at all. It's
analogous to the policy of keeping a C++ build warning-free.
___
Python
Winfried Plappert [EMAIL PROTECTED] added the comment:
I tested profile_cycle.txt on both Python 2.5.2 and Python 2.6. The
cycle you are showing for release 2.4.1 cannot be seen on both releases.
Why dont't you try and upgrade to Python 2.6?
--
nosy: +wplappert
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Let's mark this as out of date then.
--
nosy: +benjamin.peterson
resolution: - out of date
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4273
darrenr [EMAIL PROTECTED] added the comment:
Issue also occurs in 2.6. Note that it only shows up if gc is set to
save all cycles.
--
versions: +Python 2.6
Added file: http://bugs.python.org/file11961/profile_cycle_26.txt
___
Python tracker [EMAIL
Changes by Benjamin Peterson [EMAIL PROTECTED]:
--
nosy: -benjamin.peterson
resolution: out of date -
status: closed - open
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4273
___
New submission from darrenr [EMAIL PROTECTED]:
The profile module creates a reference cycle. See attached session.
--
components: Library (Lib)
files: profile_cycle.txt
messages: 75582
nosy: darrenr
severity: normal
status: open
title: cycle created by profile.run
type: resource usage
darrenr [EMAIL PROTECTED] added the comment:
The profile module creates a reference cycle. See attached session.
Note: cycle can be broken by deleting reference to 'dispatcher' on
profile.Profile() instance.
___
Python tracker [EMAIL PROTECTED]
12 matches
Mail list logo