You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Usefullness of begin.start as a boolean function #63
Hi, this is a really great library, the first high level command-line app library I actually like (but as we all have our quirky ways of doing scripts I will be making some pull requests for side features like completion or no double flags)! There is just something that bugs me: what is the benefit of using if begin.start() over the more conventional if __name__ == '__main__' as it seems to be strictly equivalent (but more complicated since you can't just check the globals and have to fiddle with the global stackframe)?
That's what I was thinking. So I am going to argue in favor of deprecating this (and later dropping this feature) because begin.start is just a big overloaded mess that can either be a decorator or a decorator factory or a boolean function and because this is a duplicate that will only confuse python users (there should be only one obvious way to do it).
Activity
[-]Usefullness of `begin.start` as a boolean function[/-][+]Usefullness of begin.start as a boolean function[/+]evanunderscore commentedon Dec 13, 2016
The only real difference is cosmetic - they do the same thing.
Lapin0t commentedon Dec 13, 2016
That's what I was thinking. So I am going to argue in favor of deprecating this (and later dropping this feature) because
begin.startis just a big overloaded mess that can either be a decorator or a decorator factory or a boolean function and because this is a duplicate that will only confuse python users (there should be only one obvious way to do it).evanunderscore commentedon Dec 13, 2016
Though he doesn't specifically mention the boolean part, here's what Aaron had to say about this. For what it's worth, I agree with you.