What’s New in Python 3.12–3.14

Introduction

Python continues its rapid evolution—from performance gains and developer ergonomics to deprecation cleanup. If you’re working with Python in 2025, here’s everything you need to know about recent enhancements, deprecated features, and how to prepare your code for the future.


1. What’s New in Python 3.12 (Released October 2023)

Core Language & Performance Boosts

  • PEP 695 – Type parameters & the type statement
    Introduces cleaner syntax for generics and type aliases, making type hints more ergonomic Python documentation.
  • PEP 701 – F-strings in grammar
    Removes previous limitations around f‑strings—for example, using them directly in lambdas or default values Python documentation.
  • PEP 684 – Per-interpreter GIL
    The Global Interpreter Lock (GIL) can now be scoped to subinterpreters, paving the way toward better concurrency Python documentationWikipedia.
  • Improved error suggestions
    The interpreter continues to get better at “Did you mean…” hints for imports, names, and syntax mistakes Python documentation.

Library and Standard Modules Improvements

Removals & Deprecations

Python 3.12 removed a lot of legacy cruft:

  • C‑API wstr and wstr_length members (PEP 623) Python.orgPython.org.
  • Long-deprecated unittest methods (deprecated since Python 3.1/3.2) Python.org.
  • A raft of old APIs: ssl.wrap_socket(), ssl.match_hostname(), configparser.SafeConfigParser, sqlite3.enable_shared_cache(), io.OpenWrapper, gzip’s filename attribute, randrange(float), and more pradyunsg-cpython-lutra-testing.readthedocs.io.
  • Invalid string escapes now trigger SyntaxWarning—they’ll become errors in a future releasePython.orgReddit.

2. Python 3.13 (Released October 2024)

Developer Experience & Productivity Enhancements

  • Modern REPL interface
    The interactive shell now supports syntax-colored prompts, better multiline editing, block recall via Up‑arrow, and improved paste handling—with prompts automatically managed Real Python.
  • Colorized tracebacks & enhanced tips
    Tracebacks are now colorized by default, and missing keyword‑arg suggestions are smarter (e.g., suggesting reverse when you type reversed=True) Real PythonGeeksforGeeks.

Under-the-Hood Performance Features

  • Experimental free-threaded CPython
    PEP 703 allows an opt-in build without the GIL—enabling true multi-threaded execution. Still experimental, but a major milestone Real PythonMediumWikipedia.
  • JIT compiler preview
    PEP 744 introduces an experimental JIT using LLVM—disabled by default, but demonstrating early performance gains Real PythonWikipedia.

Typing & Syntax Refinements

  • Type parameter defaults
    Now you can supply default type arguments, improving generic programming ergonomics Python documentationMedium.
  • Defined locals() semantics
    Assigning to the dict returned by locals() now has predictable behavior, thanks to PEP 667 Python documentationMedium.
  • Self types and TypedDict enhancements
    Continued improvements in typing expressiveness (e.g. Self keyword and refined TypedDict capabilities) Python documentationMedium.

Standard Library and Module Updates

  • Removed “dead battery” modules
    Modules marked for removal in 3.11 are now gone (e.g., deprecated ones per PEP 594) Python documentationGeeksforGeeks.
  • Argparse deprecation support
    You can now mark options, args, or subcommands as deprecated directly in your CLI apps Real Python.
  • Incremental GC is out
    A rewritten garbage collector was in early 3.13 betas—but pulled before final release due to regression issues Real Python.
  • iOS/Android tier‑3 support
    Python imports for iOS and Android now gain tier-3 (semi-official) platform support Real Python.

3. What to Expect in Python 3.14 and Beyond

  • Python 3.14 Beta ongoing as of early 2025
    Adds a new opt-in interpreter with substantial performance improvements (~30%), plus refined error diagnosis and more syntax enhancements Wikipedia.
  • Future Removals & Deprecations
    • The old array 'u' format code deprecated in 3.13 will be removed by Python 3.16 Wikipedia.
    • http.server.CGIHTTPRequestHandler flagged for removal by 3.15 due to fallback of OpenSSL’s internal hostname verification replacing ssl.match_hostname() Wikipedia.
    • Many typing constructs (e.g. typing.NamedTuple with kwargs) will be disallowed by 3.15 Wikipedia.

4. What This Means for Developers

Compatibility & Refactoring Planning

  • Audit for removed modules and APIs
    Migration paths:
    • distutilssetuptools
    • smtpdaiosmtpd
    • Use str instead of removed unicode C-API wstr structures.
  • Address string escape warnings now
    Fix any silent escape sequences—future versions may break them.
  • Check places using locals() mutation or weird type hacks
    Make sure you aren’t relying on undefined or legacy behavior around locals().

Performance Strategy

  • Start experimenting with free-threaded builds and JIT
    These are opt-in—great for benchmarking and getting ahead on concurrency and speed gains.
  • Benchmark against CPython 3.13/3.14
    You’ll likely see small gains now, but bigger ones as the JIT matures and performance improvements land in 3.14.

Developer Experience Enhancements

  • Enjoy the better REPL for experiments and debugging—multiline recall and color tracebacks streamline interaction.
  • Try using improved error suggestions and type defaults to boost your code’s clarity.

Summary Table: At-a-Glance Timeline

ReleaseHighlights
Python 3.12 (Oct 2023)Generics syntax, f-strings in grammar, per-interpreter GIL, asyncio speed, CLI tools
Python 3.13 (Oct 2024)Modern REPL, colored errors, experimental GIL-free mode & JIT, typo hints, typing tweaks
Python 3.14+Faster opt-in interpreter, removal of old formats/APIs, further typing deprecations

Final Thoughts

Python in 2025 is evolving rapidly—not only refining developer comfort with REPL improvements and sharper error messages but also making bold moves with experimental JIT and GIL-free threading. To stay ahead:

  1. Upgrade to 3.12/3.13 in dev environments—try new REPL and CLI features.
  2. Audit your codebase for deprecated modules and syntax now; future versions will drop them.
  3. Begin experimenting with performance-oriented builds if you work on high-throughput or concurrent systems.
  4. Keep an eye on 3.14’s beta—it’s shaping up to be a breakthrough in interpreter speed.