
Aug. 7, 2020
5:12 p.m.
On 2020-08-07 13:13, Jonathan Fine wrote:
We are discussing a proposal to extend Python's syntax to allow d[1, 2, a=3, b=4]
We are also discussing the associated semantics. At present d[1, 2] d[(1, 2)] are semantically equivalent.
Python behaves as though it's wrapping parentheses around the index: d[1, 2] => d[(1, 2)] d[(1, 2)] => d[((1, 2))] == d[(1, 2)]
There is a proposal, that d[1, 2, a=3, b=4] d[(1, 2), a=3, b=4] be semantically equivalent.
Will adding keyword arguments break existing code? No, because they're currently not allowed. Python doesn't even allow you to unpack with *, so that won't break existing code either. [snip]