> 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
[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
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
>}
>
>
> 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
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,
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
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