Re: [Python-Dev] Object creation hook

2007-01-27 Thread Martin v. Löwis
Kristján V. Jónsson schrieb: We have been using gc.get_objects() but it has several problems: 1) It returns all objects in the system. Actually, it doesn't. It only returns objects that participate in cyclic GC (i.e. container objects). 2) There is no way to frame certain operations and get

Re: [Python-Dev] Object creation hook

2007-01-26 Thread Greg Ewing
Kristján V. Jónsson wrote: (I was a bit dismayed that I couldn't assign to object.__init__ post-hoc from a python script, I'm fairly sure that is possible in Ruby :) It wouldn't do you much good anyway, because no existing subclass of object having its own __init__ method would call it. --

Re: [Python-Dev] Object creation hook

2007-01-26 Thread Neal Norwitz
on my machine and then I'll maybe be able to understand the crash case better. Cheers, Kristján -Original Message- From: Martin v. Löwis [mailto:[EMAIL PROTECTED] Sent: 23. janúar 2007 23:32 To: Kristján V. Jónsson Cc: 'python-dev@python.org' Subject: Re: [Python-Dev] Object

Re: [Python-Dev] Object creation hook

2007-01-24 Thread Kristján V. Jónsson
be able to understand the crash case better. Cheers, Kristján -Original Message- From: Martin v. Löwis [mailto:[EMAIL PROTECTED] Sent: 23. janúar 2007 23:32 To: Kristján V. Jónsson Cc: 'python-dev@python.org' Subject: Re: [Python-Dev] Object creation hook Kristján V. Jónsson schrieb: I am

[Python-Dev] Object creation hook

2007-01-23 Thread Kristján V. Jónsson
Hello there. I am trying to insert a hook into python enabling a callback for all just-created objects. The intention is to debug and find memory leaks, e.g. by having the hook function insert the object into a WeakKeyDictionary. I have already added a method to object to set such a hook, and

Re: [Python-Dev] Object creation hook

2007-01-23 Thread Mike Klaas
On 1/23/07, Kristján V. Jónsson [EMAIL PROTECTED] wrote: Hello there. I am trying to insert a hook into python enabling a callback for all just-created objects. The intention is to debug and find memory leaks, e.g. by having the hook function insert the object into a WeakKeyDictionary. I

Re: [Python-Dev] Object creation hook

2007-01-23 Thread Steve Holden
Kristján V. Jónsson wrote: Hello there. I am trying to insert a hook into python enabling a callback for all just-created objects. The intention is to debug and find memory leaks, e.g. by having the hook function insert the object into a WeakKeyDictionary. I have already added a method

Re: [Python-Dev] Object creation hook

2007-01-23 Thread Martin v. Löwis
Kristján V. Jónsson schrieb: I am trying to insert a hook into python enabling a callback for all just-created objects. The intention is to debug and find memory leaks, e.g. by having the hook function insert the object into a WeakKeyDictionary. I'd like to point out that this isn't a