Re: Calling every method of an object from __init__

2006-06-20 Thread bruno at modulix
Tim Chase wrote: (snip) class Foo(object): > ... def __init__(self): > ... for method in dir(self): > ... if method == method.strip("_"): if not method.startswith('_'): -- bruno desthuilliers python -c "print '@'.join(['.'.join([

Re: Calling every method of an object from __init__

2006-06-20 Thread Ten
On Monday 19 June 2006 20:55, Rob Cowie wrote: > Hi all, > > Is there a simple way to call every method of an object from its > __init__()? > > For example, given the following class, what would I replace the > comment line in __init__() with to result in both methods being called? > I understand t

Re: Calling every method of an object from __init__

2006-06-19 Thread John Machin
On 20/06/2006 5:55 AM, Rob Cowie wrote: > Hi all, > > Is there a simple way to call every method of an object from its > __init__()? > > For example, given the following class, what would I replace the > comment line in __init__() with to result in both methods being called? > I understand that I

Re: Calling every method of an object from __init__

2006-06-19 Thread George Sakkis
Rob Cowie wrote: > Hi all, > > Is there a simple way to call every method of an object from its > __init__()? > > For example, given the following class, what would I replace the > comment line in __init__() with to result in both methods being called? > I understand that I could just call each me

Re: Calling every method of an object from __init__

2006-06-19 Thread K.S.Sreeram
Rob Cowie wrote: > class Foo(object): > def __init__(self): > #call all methods here > def test(self): > print 'The test method' > def hello(self): > print 'Hello user' class Foo(object): def __init__(self): for k in dir(self) : if not k.

Re: Calling every method of an object from __init__

2006-06-19 Thread Tim Chase
> Is there a simple way to call every method of an object from its > __init__()? > > For example, given the following class, what would I replace the > comment line in __init__() with to result in both methods being called? > I understand that I could just call each method by name but I'm looking

Calling every method of an object from __init__

2006-06-19 Thread Rob Cowie
Hi all, Is there a simple way to call every method of an object from its __init__()? For example, given the following class, what would I replace the comment line in __init__() with to result in both methods being called? I understand that I could just call each method by name but I'm looking for