magmax/python-inquirer

Add statement list for ignore option

Closed this issue · 2 comments

grm34 commented

Hi and thank you for this very useful module !

Is is possible to use more than one function for ignore option?

Very helpful to handle ignores, such as not have to create a specific function for each question but ignore this or that condition.

ignore=[function1, function2]

❤️

Do you really need something like that?

I mean... Something like that is a problem. Those functions are joined by AND or by OR. Why?

So the best solution is to use a lambda instead:

ignore=lambda x,y:function1(x,y) or function2(x,y)

Now it is really clear.

If you are using the json-style, I suggest you to create a named function with same functionality.

Anyways... thank you for the suggestion!

grm34 commented

@magmax thanks quick answer !

It was to handle messages which have same ignore conditions but which globaly differs but absolutely as you said and after reflexion it's safest to handle that in a named function.

If you are using the json-style, I suggest you to create a named function with same functionality.

👍