Re: executing list of methods (and collecting results)

2007-09-21 Thread David
> I wondering if is this a good pattern to apply, i like the way it looks > like, at least to me it looks `natural', but...im calling every method > twice here? One in v_dict and again on the dict iteration? > > Any suggestion will be great! Another suggestion is to use a naming convention for you

Re: executing list of methods (and collecting results)

2007-09-21 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Haha, no, the actual methods do other kind of things. > Thanks Björn!!! Okay, so I hoped. Glad to be of help. Regards, Björn -- BOFH excuse #233: TCP/IP UDP alarm threshold is set too low. -- http://mail.python.org/mailman/listinfo/python-list

Re: executing list of methods (and collecting results)

2007-09-21 Thread Paul Hankin
On Sep 21, 12:26 am, Gerardo Herzig <[EMAIL PROTECTED]> wrote: > def collect_validators(self): > v_dict = { 'is_really_a_number': is_really_a_number, > 'is_even': is_even, > 'is_greater_than_zero', is_greater_than_zero >} > >

Re: executing list of methods (and collecting results)

2007-09-20 Thread gherzig
> Gerardo Herzig wrote: > >> I want the collect_validators() method is to execute any of the >> above methods, and collect their names as items of a list (wich >> will be the collect_validators() return value). > > (inside class definition -- untested) > validators = {"is a number": is_really_a_num

Re: executing list of methods (and collecting results)

2007-09-20 Thread Bjoern Schliessmann
Gerardo Herzig wrote: > I want the collect_validators() method is to execute any of the > above methods, and collect their names as items of a list (wich > will be the collect_validators() return value). (inside class definition -- untested) validators = {"is a number": is_really_a_number,

Re: executing list of methods (and collecting results)

2007-09-20 Thread James Stroud
Gerardo Herzig wrote: > Hi all. Im in this situation: I want to perform several kind of > (validating) methods to a given value. > Lets say i have a class named Number, and the following methods: > is_really_a_number(), > is_even(), > is_greater_than_zero(), > and so on. All of them returning bool

executing list of methods (and collecting results)

2007-09-20 Thread Gerardo Herzig
Hi all. Im in this situation: I want to perform several kind of (validating) methods to a given value. Lets say i have a class named Number, and the following methods: is_really_a_number(), is_even(), is_greater_than_zero(), and so on. All of them returning booleans. I want the collect_validators