└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # python-version-cheat-sheet 2 | about the what and when of new python features 3 | 4 | ## overview 5 | 6 | ### python 3.0 7 | - introduction of **extended iterable unpacking** which enables e.g. `a, *b, c = [1, 2, 3, 4, 5]` so `b` becomes `[2, 3, 4]` 8 | ([PEP 3132](https://www.python.org/dev/peps/pep-3132/)) 9 | 10 | ### python 3.3 11 | - introduction of **yield from** 12 | ([PEP380](https://peps.python.org/pep-0380/)) 13 | 14 | ### python 3.4 15 | - introduction of **pathlib** 16 | ([PEP 428](https://www.python.org/dev/peps/pep-0428/)) 17 | 18 | ### python 3.5 19 | - introduction of **type annotations** 20 | ([PEP 484](https://www.python.org/dev/peps/pep-0484/)) 21 | - **ATTENTION**: you cannot use **type annotations** for variables yet; instead use type comments 22 | - introduction of **additional unpacking generalizations** 23 | ([PEP 448](https://peps.python.org/pep-0448/)) 24 | 25 | ### python 3.6 26 | - introduction of **type annotations** for variables 27 | ([PEP 526](https://www.python.org/dev/peps/pep-0526/)) 28 | - **f-strings** 29 | ([PEP 498](https://www.python.org/dev/peps/pep-0498/)) 30 | - introduction of **underscores in numeric literals**, e.g. `1_000` 31 | ([PEP 515](https://www.python.org/dev/peps/pep-0515/)) 32 | 33 | ### python 3.7 34 | - **postponed evaluation of annotations** via `from __future__ import annotations` 35 | ([PEP 563](https://www.python.org/dev/peps/pep-0563/)) 36 | - **sort order of dicts** is now guaranteed 37 | - introduction of `breakpoint()`, additionally to `import pdb;pdb.set_trace()` 38 | ([PEP 553](https://www.python.org/dev/peps/pep-0553/)) 39 | - introduction of **data classes** 40 | ([PEP 557](https://www.python.org/dev/peps/pep-0557/)) 41 | 42 | ### python 3.8 43 | - introduction of the **walrus operator** 44 | ([PEP 572](https://www.python.org/dev/peps/pep-0572/)) 45 | 46 | ### python 3.9 47 | - **builtin generic types**, that means you can use `list` and `dict` for type annotations, instead of importing e.g. `from typing import List` 48 | ([PEP 585](https://www.python.org/dev/peps/pep-0585/)) 49 | 50 | ### python 3.10 51 | - allow writing union types as X | Y 52 | ([PEP 604](https://www.python.org/dev/peps/pep-0604/)) 53 | - introduction of **structural pattern matching**, which is a kind of switch/case on steroids 54 | ([PEP 622](https://www.python.org/dev/peps/pep-0622/)) 55 | 56 | ### python 3.11 57 | - **exception groups and except\***, a new standard to raise and handle multiple unrelated exceptions simultaneously 58 | ([PEP654](https://peps.python.org/pep-0654/)) 59 | - support for parsing TOML in the standard library via **tomllib** 60 | ([PEP 680](https://peps.python.org/pep-0680/)) 61 | 62 | ## official changelog 63 | 64 | Do you need all the nitty gritty details? 65 | 66 | - [official changelog](https://docs.python.org/3/whatsnew/changelog.html) 67 | 68 | 69 | ## contributing 70 | 71 | Do you think this overview is useful? Share it! 72 | 73 | Do you think you can contribute? Do not hesitate! 74 | 75 | But let's keep it simple. This should not become a second changelog. 76 | --------------------------------------------------------------------------------