Search

Suggested keywords:
  • Java
  • Docker
  • Git
  • React
  • NextJs
  • Spring boot
  • Laravel

Python 3.13 New Features With JIT Compiler, Free Threaded CPython and More

  • Share this:

post-title

Python is a general purpose programming language that lets you work more quickly and integrate your systems more effectively. It is more powerful, fast and runs in all platforms. Recently Python has released version 3.13 with notable features.

Better Interpreter (REPL)

Python now uses a new interactive shell by default, based on code from the PyPy project. The new interpreter has support for Multi-line editing, Prompts and tracebacks with color enabled by default. History of commands are now preserved and it can be easily look backed. In previous version, help(), exit(), and quit() commands should be used as a function. Now in this release, it can be just used as a command help, exit and quit.

Function F1 key is used to list help and F2 is used to browse history. 

 

Better way of displaying errors

The interpreter uses colors by default to display error messages. This will help in locating error messages, it will give better visibility. In addition to this, added support for auto suggest and helpful error messages. In case of an error, better descriptive error messages will displayed and also the interpreter provides better suggestion which will help developers to narrow down the issue.

 

Free-threaded CPython

CPython now has experimental support for running in a free-threaded mode, with the global interpreter lock (GIL) disabled. Free-threaded execution allows for full utilization of the available processing power by running threads in parallel on available CPU cores. This is an experimental feature and therefore is not enabled by default. The free-threaded mode requires a different executable, usually called python3.13t or python3.13t.exe. 

 

Just-in-time (JIT) compiler

To speed up the Python programs, just-in-time (JIT) compiler is added. This is an experimental feature. As like in Java, JIT compilation is a step by step approach to compile the code to native machine code. First Python code is compiled to Tier 1 byte code which is then translated to intermediate representation of micro-ops instruction which is called as Tier 2. Tier 2 code is further optimized and translated to machine code.

 

Memory Optimization for Docstrings

This feature tackles a hidden source of memory usage and file size associated with docstrings in Python code. Its advantage is having reduced memory footprint for compiled bytecode files and lower memory usage during program execution.

 

Removal of Deprecated Modules

Scheduled removal of listed deprecated modules. aifc, audioop, chunk, cgi, cgitb, crypt, imghdr, mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, telnetlib, uu, xdrlib, lib2to3.

 

Other Enhancements

Added support for iOS and Android mobile platforms

The location of a .python_history file can be changed via the new PYTHON_HISTORY environment variable. 

Add dbm.sqlite3, a new module which implements an SQLite backend, and make it the default dbm backend.

Editorial Team

About author
This article is published by our editorial team.