Skip to content

Latest commit

 

History

History

python-313

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Python 3.13 Demos

This repository contains sample code and data files that demonstrate some of the new features in Python 3.13.

Introduction

You need Python 3.13 installed to run these examples. See the following tutorial instructions:

Note that for testing the free-threading and JIT features, you'll need to build Python from source code with additional compiler flags enabled, as explained in the tutorial. Alternatively, you can run benchmarks using Docker containers as explained below.

You can learn more about Python 3.13's new features in the following Real Python tutorials:

You'll find examples from these tutorials in this repository.

Examples

This section only contains brief instructions on how you can run the examples. See the tutorials for technical details.

REPL

The following examples are used to demonstrate different features of the new REPL:

Error messages

Run the scripts in the errors/ folder to see different error messages produced by Python 3.13.

Free-Threading and JIT

You need to enable a few build options to try out the free-threading and JIT features in Python 3.13. You can find more information in the dedicated README file.

Static typing

Run the scripts in the typing/ folder to try out the new static typing features.

Other features

The following scripts illustrate other new features in Python 3.13:

  • replace.py: Use copy.replace() to update immutable data structures.
  • paths.py and music/: Glob patterns are more consistent.
  • docstrings.py: Common leading whitespace in docstrings is stripped.

Authors

License

Distributed under the MIT license. See LICENSE for more information.