Re: instance + classmethod question

2005-12-12 Thread Mike Meyer
Laszlo Zsolt Nagy <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>Laszlo Zsolt Nagy <[EMAIL PROTECTED]> writes: >>>Is it possible to tell, which instance was used to call the >>>classmethod that is currently running? >>Ok, I read through what got to my nntp server, and I'm still >>completely conf

Re: instance + classmethod question

2005-12-12 Thread Laszlo Zsolt Nagy
Mike Meyer wrote: >Laszlo Zsolt Nagy <[EMAIL PROTECTED]> writes: > > >>Is it possible to tell, which instance was used to call the >>classmethod that is currently running? >> >> > >Ok, I read through what got to my nntp server, and I'm still >completely confused. > >A class method isn't nece

Re: instance + classmethod question

2005-12-11 Thread Mike Meyer
Laszlo Zsolt Nagy <[EMAIL PROTECTED]> writes: > Is it possible to tell, which instance was used to call the > classmethod that is currently running? Ok, I read through what got to my nntp server, and I'm still completely confused. A class method isn't necessarilry called by an instance. That's wh

Re: instance + classmethod question

2005-12-11 Thread Steven Bethard
Laszlo Zsolt Nagy wrote: > In my methods, most code is about string manipulation and calling other > classmethods. > There are only a few places where I can use an instance, but it is not > required. > I would like to reuse as most code as possible, so I do not want to > create two different > m

Re: instance + classmethod question

2005-12-11 Thread Laszlo Zsolt Nagy
Hello Steven, I already implemented this using the form @classmethod def methodname(cls,other_params,self=None) but your example code looks so neat! This is exactly what I needed. :-) In my methods, most code is about string manipulation and calling other classmethods. There are only a few

Re: instance + classmethod question

2005-12-11 Thread Steven Bethard
Laszlo Zsolt Nagy wrote: > > Hello, > > Is it possible to tell, which instance was used to call the classmethod > that is currently running? > [snip] > > processor = SQLProcessors.StdOutProcessor() # Print to stdout > PostgreSQLConnection.process_create_tables(processor,dbdef) # This > soul

instance + classmethod question

2005-12-11 Thread Laszlo Zsolt Nagy
Hello, Is it possible to tell, which instance was used to call the classmethod that is currently running? Background: I have a class called DatabaseConnection and it has a classmethod called process_create_tables. This method should create some database tables defined by a database definiti