The unpacking/splat operators *
and **
differ widely in their applicability across python versions (2.7, 3.x < 3.5 and 3.x >= 3.5).
For example:
| 2.7 | 3.1-3.4 | 3.5
----------------------------------------------------------------------
function(*args) ? ? ?
x, *y, z = [1, 2, 3, 4, 5] x ? ?
{**x, **y} x x ?
Are there any more discrepancies between the various versions that I've missed? I'm looking through PEP and Readmes but the docs aren't detailed with this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…