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, but if Sedrubal cares enough to raise the idea, it could be discussed.
However, sum should be taken off the list. The problem with accepting variadic
args is that it clashes with current behaviour:
sum( [[1], [2], [3]], [4, 5] )
That would be ambiguous. Under the suggested variadic form, that should return
a list:
[[1], [2], [3], 4, 5]
but it already has a meaning in Python today:
[4, 5, 1, 2, 3]
So sum() with variadic args would be ambiguous, or would break backwards
compatibility. Neither of those would be acceptable.
----------
nosy: +steven.daprano
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29433>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com