Description
Why Python 3? is a single-page reference that shows, with short runnable code samples, the language features that make Python 3 worth moving to from Python 2. Each example highlights one feature, often next to the more awkward Python 2 way of doing the same thing. Topics include redirecting stdout with contextlib, ordered and more memory-efficient dictionaries, dictionary merging, ExitStack, automatic super, numeric literals, f-strings, type annotations, yield from, advanced unpacking, suppressing exceptions, and standard library modules such as secrets, pathlib, ipaddress and enum, plus the LRU cache decorator and keyword-only arguments. An 'Another!' button moves to the next feature and a 'Try it out' option lets you run the code. It is useful for developers still on Python 2 or anyone wanting a quick tour of modern Python features.…
Highlights
- Code examples for over a dozen Python 3 features
- Side-by-side comparison with Python 2 approaches
- Covers f-strings, pathlib, enum, secrets, unpacking and more
- Button to step through features one at a time
Ratings & Reviews
No ratings yet
Be the first to rate Why Python 3?.
People also visit
Why Python 3? FAQ
What is Why Python 3?
A web page that demonstrates useful Python 3 features with short code snippets, to encourage developers to upgrade from Python 2.
Which features does it cover?
Among others: redirect_stdout, ordered dictionaries, dictionary merging, ExitStack, f-strings, annotations, yield from, advanced unpacking, suppress, secrets, pathlib, lru_cache, keyword-only arguments, ipaddress and Enum.
Can I run the examples?
The page has a 'Try it out' option next to the code samples.
Is the source available?
The page links to a GitHub repository at github.com/kichik/whypy3.
What are the best Why Python 3? alternatives?
Popular alternatives to Why Python 3? include Laboratory, Python Devtools and Pybites. See all Why Python 3? alternatives







