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.
Around 1992 (not sure about Python version). This is from the Grammar file of Python 1.0.1.
Python 1.4+:
Python 1.6+
Python <= 2.7:
Tuple parameter unpacking was removed in Python 3.0.
Python 3.0+
Python 3.5+
As far as I know there's no single page that lists all the syntax changes. Per version syntax changes are listed in the What's new in Python section or you could check the Grammar specification of each release to see the differences.