days
-4
-1
hours
-2
-3
minutes
-4
-1
seconds
0
-2
search
JAX Developers Puzzle deadline approaching: Play for a chance to win a complimentary JAX London 2018 ticket!
Stay up to date with the latest version

Python sheds its skin for version 3.7

Sarah Schlothauer
python
© Shutterstock / Suthat Chaithaweesap

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:

Data classes

You can now declare data classes. “A data class describes its attributes using class variable annotations. Its constructor and other magic methods, such as __repr__()__eq__(), and__hash__() are generated automatically.”

Find out more about data classes and what you can do with this new decorator here.

SEE ALSO: New from Facebook: Meet Pyre, a static type checker for Python

Built-in breakpoint()

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:

“Built-in breakpoint() calls 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 breakpoint().”

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

Version 3.7 has added async and await as reserved keywords.

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?

Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University in Long Branch, New Jersey and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of