On 06/23/2010 02:56 PM, John Reid wrote:
>
>
> Thomas Jollans wrote:
>>> The InstanceCounted.count is 1 at the end. If I omit the call to
>>> "self.method = print_exception_decorator(self.method)" then the instance
>>> count goes down to 0 as desired. I thought that the decorator might be
>>> hol
Thomas Jollans wrote:
The InstanceCounted.count is 1 at the end. If I omit the call to
"self.method = print_exception_decorator(self.method)" then the instance
count goes down to 0 as desired. I thought that the decorator might be
holding a reference to the instance through the bound method, so
> The InstanceCounted.count is 1 at the end. If I omit the call to
> "self.method = print_exception_decorator(self.method)" then the instance
> count goes down to 0 as desired. I thought that the decorator might be
> holding a reference to the instance through the bound method, so I added
> t
John Reid wrote:
> Hi,
>
> I've written a decorator that prints exceptions and I'm having some
> trouble with garbage collection.
>
> My decorator is:
>
> import sys
> def print_exception_decorator(fn):
> def decorator(self, *args, **kwds):
> try:
> return fn(*args, *
On 06/23/2010 01:40 PM, John Reid wrote:
> Hi,
>
> I've written a decorator that prints exceptions and I'm having some
> trouble with garbage collection.
>
> My decorator is:
>
> import sys
> def print_exception_decorator(fn):
> def decorator(self, *args, **kwds):
> try:
>
Hi,
I've written a decorator that prints exceptions and I'm having some
trouble with garbage collection.
My decorator is:
import sys
def print_exception_decorator(fn):
def decorator(self, *args, **kwds):
try:
return fn(*args, **kwds)
except:
print '