Message268183
Here is a new patch that also updates the documentation for list etc displays as well as function calls. Let me know what you think.
The 3.5 What’s New notes were written separately; Neil’s patch was never applied. But I have rescued his update for functools.partial() in my new patch.
While experimenting with the current behaviour, I found some surprising inconsistencies. The following syntaxes are allowed:
>>> x, *y
>>> a = x, *y
>>> f"{x, *y}" # New in 3.6
>>> async def f(): await x, *y
But the following all produce “SyntaxError: invalid syntax”:
>>> a += x, *y
>>> eval("x, *y")
>>> def f(): return x, *y
>>> def f(): yield x, *y
>>> for i in x, *y: ...
Also, the expressions allowed for unpacking in general are more limited than in function calls:
>>> f(x, *y == z) # Allowed
>>> (x, *y == z)
SyntaxError: invalid syntax |
|
Date |
User |
Action |
Args |
2016-06-11 05:25:17 | martin.panter | set | recipients:
+ martin.panter, barry, terry.reedy, paul.moore, vstinner, tim.golden, benjamin.peterson, ezio.melotti, r.david.murray, docs@python, berker.peksag, zach.ware, steve.dower, NeilGirdhar, moigagoo, JelleZijlstra, supriyanto maftuh, supriyantomaftuh |
2016-06-11 05:25:17 | martin.panter | set | messageid: <1465622717.19.0.77941477666.issue24136@psf.upfronthosting.co.za> |
2016-06-11 05:25:17 | martin.panter | link | issue24136 messages |
2016-06-11 05:25:16 | martin.panter | create | |
|