Message286864
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. |
|
Date |
User |
Action |
Args |
2017-02-03 13:38:54 | steven.daprano | set | recipients:
+ steven.daprano, serhiy.storchaka, sedrubal |
2017-02-03 13:38:54 | steven.daprano | set | messageid: <1486129134.8.0.10373232361.issue29433@psf.upfronthosting.co.za> |
2017-02-03 13:38:54 | steven.daprano | link | issue29433 messages |
2017-02-03 13:38:54 | steven.daprano | create | |
|