Python sheds its skin for version 3.7
Python version 3.7 is here and ready for download! See what changes have been made and what new features there are in store in the newest version.
Python 3.7 is here and with it come a few changes and some new features. Python has seen massive growth since its creation, and continues to be a programming favorite, for good reason too. The June TIOBE Index lists Python as the number 4 most popular programming language, with a slight trend upwards in usage. Predictions can be made that this will continue to grow, so long as smart features are added and supported in further updates to come.
Despite being a minor update, there’s a fair amount of things to explore. For a detailed look at what’s in store, browse through the release notes.
In a nutshell, Python 3.7 is fast. Wave goodbye to the slow lane, because Python is is revving up. Without further ado, here are just a few changes Python has made compared to version 3.6:
You can now declare data classes. “A data class describes its attributes using class variable annotations. Its constructor and other magic methods, such as
__hash__() are generated automatically.”
Find out more about data classes and what you can do with this new decorator here.
Here comes a new function that makes it easy to enter the debugger without having to resort to a third-party solution. Let’s see what the release notes say about this:
sys.breakpointhook(). By default, the latter imports
pdb and then calls
pdb.set_trace(), but by binding
sys.breakpointhook() to the function of your choosing,
breakpoint() can enter any debugger. Additionally, the environment variable
PYTHONBREAKPOINT can be set to the callable of your debugger of choice. Set
PYTHONBREAKPOINT=0 to completely disable built-in
New syntax features
Python has fixed some usability issues with annotations. Previously, annotations did not support forward references and the annotation source code was affecting some start up time. Now, Python is focusing on speedier performance and fixed these issues, so your programs will run faster and smoother. Annotations also now support forward references.
The release notes state that this will become the default in Python 4.0, so best check it out now and stay on top of your Python game so you are ready for future updates.
SEE ALSO: Top 5 IDEs and code editors for Python
Backwards incompatible syntax changes
Previously, version 3.5 was concerned with potential backwards compatibility and these were not reserved. This is no longer the case and you may no longer name any variables as such.
This is just the tip of the iceberg. Python has added a host of new features including:
- New library modules, including context variables
- Data model improvements, including core support for typing module and generic types
- Legacy C locale coercion
- forced UTF-8 runtime mode
- New documentation translations, including Japanese, French, and Korean
Changes big and small, we always look forward to seeing what the new version of Python brings to the table. Version 3.7 will continue to receive bug fixes for approximately 18 months. Download the newest version and get slithering away to your code!
How you feel about these updates; love ’em or leave ’em? What will the next Python update have?