Python 3.12.0 (2023-10-02)

Annonce Python 3.12

#Python3.12.0 #Python3.12 #Python

Annonce Python 3.12 rc2

New grammar features

Interpreter improvements

Sub-interpreters may now be created with a unique GIL per interpreter. This allows Python programs to take full advantage of multiple CPU cores .

New typing features

PEP 692: Using TypedDict for more precise **kwargs typing

PEP 692: Using TypedDict for more precise **kwargs typing

Typing **kwargs in a function signature as introduced by PEP 484 allowed for valid annotations only in cases where all of the **kwargs were of the same type.

This PEP specifies a more precise way of typing **kwargs by relying on typed dictionaries

from typing import TypedDict, Unpack

class Movie(TypedDict):
  name: str
  year: int

def foo(**kwargs: Unpack[Movie]):
    pass

See PEP 692 for more details .

(Contributed by Franek Magiera in gh-103629 )

what-didnt-make-the-headlines

And my favorite, an uid generator:

python3.12 -m uuid
a3b10cab-064d-456e-ac9a-58a125171218

Other (Remove wstr from Unicode and python 3.12 releases)

Improved Modules

calendar

  • Add enums Month and Day. (Contributed by Prince Roshan in gh-103636.)

unicodedata

The Unicode database has been updated to version 15.0.0. (Contributed by Benjamin Peterson in gh-96734 ).