[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Do you think I should send a mail to the ideas list? Personally, I don't think so. You want to write any(a, b, c, d), but you can get the same effect now by writing any([a, b, c, d]). There is unlikely to be any significant performance difference.

[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread sedrubal
sedrubal added the comment: Thanks for your answers and for showing the issue with sum. I think this would make python just a bit more sexier as it already is ;) Are there any other disadvantages (performance, ...)? Do you think I should send a mail to the ideas list? --

[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread Steven D'Aprano
Steven D'Aprano added the comment: Serhiy, that doesn't generalise to code like: any(a, b, c, *extras) which is hard to write out by hand. You would have to say bool(a or b or c or any(extras)) I think this might be worth considering on Python-Ideas. It will probably be rejected,

[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is no such need. You can use operators. any(arg1, arg2, arg3) -> arg1 or arg2 or arg3 all(arg1, arg2, arg3) -> arg1 and arg2 and arg3 sum(arg1, arg2, arg3) -> arg1 + arg2 + arg3 -- nosy: +serhiy.storchaka resolution: -> rejected stage: ->

[issue29433] any, all and sum should accept variadic args

2017-02-03 Thread sedrubal
New submission from sedrubal: any, all and sum (and maybe some other functions) should accept variadic args. It should be possible to do things like this: >>> any(True, False, True) True >>> all(True, False, True) False >>> sum(1, 2, 3) 6 This was compliant to max and min behaviour: >>>