Re: metaclasses: timestamping instances

2007-09-03 Thread Gabriel Genellina
En Mon, 03 Sep 2007 07:39:05 -0300, km <[EMAIL PROTECTED]> escribi�: > But why does it show varied difference in the time between a and b > instance creations when __metaclass__ hook is used and when not used in > class Y ? I dont understand that point ! What do you expect from a._created, b.

Re: metaclasses: timestamping instances

2007-09-03 Thread km
Hi, But why does it show varied difference in the time between a and b instance creations when __metaclass__ hook is used and when not used in class Y ? I dont understand that point ! KM On 9/1/07, Michele Simionato <[EMAIL PROTECTED]> wrote: > > On Sep 1, 6:07 pm, Steve Holden <[EMAIL PROTECTE

Re: metaclasses: timestamping instances

2007-09-01 Thread Michele Simionato
On Sep 1, 6:07 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > Debugging with Wing IDE and examining the classes at a breakpoint shows > this to be true (even after Y's __metaclass__ assignment is commented out): > > >>> X.__metaclass__ > > >>> Y.__metaclass__ > > >>> For the benefit of the

Re: metaclasses: timestamping instances

2007-09-01 Thread Steve Holden
km wrote: > Hi all, > > I have extended a prototype idea from Alex Martelli's resource on > metaclasses regarding time stamping of instances. > > > import time > class Meta(type): > start = time.time() > def __call__(cls, *args, **kw): > print 'Meta start time %e'%cls.start >

metaclasses: timestamping instances

2007-09-01 Thread km
Hi all, I have extended a prototype idea from Alex Martelli's resource on metaclasses regarding time stamping of instances. import time class Meta(type): start = time.time() def __call__(cls, *args, **kw): print 'Meta start time %e'%cls.start x = super(Meta, cls).__call_