Summary of Major Changes Between Python Versions
The article details Python updates from versions 3.7 to 3.12, highlighting async/await, Walrus operator, Type hints, F-strings, Assignment expressions, Typing enhancements, Structural Pattern Matching, Tomllib, and useful tools.
Read original articleThe article provides a comprehensive overview of the major changes introduced in various versions of Python, starting from Python 3.7 to Python 3.12. It covers significant updates such as async and await, Walrus operator, Type hints, F-strings, and more in earlier versions. Python 3.8 introduced features like Assignment expressions and Self-documenting f-strings. Python 3.9 brought improvements in Typing with Builtin Generics and Remove Prefix/Suffix functionalities. Python 3.10 introduced Structural Pattern Matching and enhancements in Typing with TypeAlias and TypeGuard. Python 3.11 included updates like Tomllib, Exception Groups, and enriching exceptions with notes. Python 3.12 featured enhancements in Typing with Type Parameter Syntax, F-string changes, and the Buffer protocol. The article also mentions useful tools like Ruff, Pyupgrade, and Black for linting and code formatting. It serves as a valuable resource for developers looking to understand and leverage the new features and improvements in each Python version efficiently.
Related
The Prototype's Language
The evolution of programming languages in payments technology sector is discussed, highlighting the shift from COBOL to Java and now to Python for its speed and adaptability. Language choice impacts developers and work quality.
What's up Python? Django get background tasks, a new REPL, bye bye gunicorn
Several Python updates include Django's background task integration, a new lightweight Python REPL, Uvicorn's multiprocessing support, and PyPI blocking outlook.com emails to combat bot registrations, enhancing Python development and security.
Elixir for Python Developers
This comparison delves into Python and Elixir, emphasizing syntax disparities and distinctive traits. Elixir prioritizes immutability and pattern matching, while Python focuses on object-oriented elements. Both share list comprehensions and parallel processing, yet Elixir's functional approach and pattern matching distinguish it. Elixir's Stream module supports lazy operations for big data, contrasting Python's I/O streams. Python developers can benefit from exploring Elixir.
Migrating from Java 8 to Java 17 II: Notable API Changes Since Java 8
The article details API changes in Java versions 9 to 17, emphasizing improvements for Java 8 migrations. Changes include null handling, performance enhancements, string improvements, switch expressions, record classes, and utility additions for developer productivity and code readability.
Python Modern Practices
Python development best practices involve using tools like mise or pyenv for multiple versions, latest Python version, pipx for app running. Project tips include src layout, pyproject.toml, virtual environments, Black, flake8, pytest, wheel, type hinting, f-strings, datetime, enum, Named Tuples, data classes, breakpoint(), logging, TOML config for efficiency and maintainability.
But of course, I have to learn all of it to understand other people's code. Python's syntax has really gotten worse. The match statement is ugly in comparison to functional languages, I'm not sure about f-strings, the with-statement extension adds new overhead to the reader.
Python is really like C++ now, except 50 times slower (yes, I know about the slow std::unordered_map special case that is due to its rigid specification).
I used to hate TypeScript (circa 2016) because it kept bugging me with typing errors, and I used to sprinkle "any" to shut it up.
Ned’s list is what I usually use.
```python if header.startswith("X-Forwarded-"): section = header.removeprefix("X-Forwarded-") ```
the `startswith()` check is unnecessary. If `header` doesn't start with "X-Forwarded-" then `header.removeprefix("X-Forwarded-")` just returns `header`.
Nice summary doc, with good examples. You can also visit [this site of mine](https://ptmcg.pythonanywhere.com/python_nutshell_app_a_searc...) to search for changes by version (3.7-3.11).
I didn't know about the pyupgrade tool. Very useful.
I'd love to see a step further, and avoid the circular import problem entirely. It's something I fight with everything time I work in Python. I find that I am forced to structure my Python programs in a way specifically designed to avoid this instead of what makes sense for organization. Or I will C+P functions if I feel that tradeoff is not worth it.
The piping and typing changes are so useful ! Bookmarked and I'll be coming back to this often.
I also caught the sleep token references. Well done .
I've missed a lot of these that I'm going to take advantage of!
Related
The Prototype's Language
The evolution of programming languages in payments technology sector is discussed, highlighting the shift from COBOL to Java and now to Python for its speed and adaptability. Language choice impacts developers and work quality.
What's up Python? Django get background tasks, a new REPL, bye bye gunicorn
Several Python updates include Django's background task integration, a new lightweight Python REPL, Uvicorn's multiprocessing support, and PyPI blocking outlook.com emails to combat bot registrations, enhancing Python development and security.
Elixir for Python Developers
This comparison delves into Python and Elixir, emphasizing syntax disparities and distinctive traits. Elixir prioritizes immutability and pattern matching, while Python focuses on object-oriented elements. Both share list comprehensions and parallel processing, yet Elixir's functional approach and pattern matching distinguish it. Elixir's Stream module supports lazy operations for big data, contrasting Python's I/O streams. Python developers can benefit from exploring Elixir.
Migrating from Java 8 to Java 17 II: Notable API Changes Since Java 8
The article details API changes in Java versions 9 to 17, emphasizing improvements for Java 8 migrations. Changes include null handling, performance enhancements, string improvements, switch expressions, record classes, and utility additions for developer productivity and code readability.
Python Modern Practices
Python development best practices involve using tools like mise or pyenv for multiple versions, latest Python version, pipx for app running. Project tips include src layout, pyproject.toml, virtual environments, Black, flake8, pytest, wheel, type hinting, f-strings, datetime, enum, Named Tuples, data classes, breakpoint(), logging, TOML config for efficiency and maintainability.