[Ml-yokadi] tui.confirm and force
Aurélien Gâteau
aurelien.gateau
Dim 15 Fév 23:35:38 CET 2009
Sébastien Renard wrote:
> Hello,
>
> In t_remove, we have that code :
>
> if not options.force:
> if not tui.confirm("Remove task '%s'" % task.title):
> return
> do something
>
> How about simplify it with :
>
> if options.force or tui.confirm("Remove task '%s'" % task.title):
> do something
I prefer keeping indentation level at the minimum, that is why I like to
just call return if there is no need to continue the function. Having
said that, the two if should be combined into one, it really is just an
"and".
Aurélien
Plus d'informations sur la liste de diffusion Ml-yokadi