Cover image for Whats new in Python 3.13a

Whats new in Python 3.13a

A summary of the new features in Python 3.13a

Python 3.13 removes outdated modules, enhances features, and optimizes efficiency

21 November 2023 by | Share this article on

As an avid user of Python I thought it would be a smart move to get closer to each new release as they come out so that I know if there are new features worth trying out or if things are changing that are noteworthy.

Python 3.13 is still in development (hence the 3.13a moniker) and once its officially released I’ll update this post with the full details of the changes, but for now, here is a summary of the new features in Python 3.13a.

Python 3.13 introduces several notable changes and improvements:

  1. Deprecations and Removals: Python 3.13 removes 19 “dead batteries” from the standard library, including modules like cgi, cgitb, msilib, and telnetlib, as part of PEP 594.

  2. New Features and Language Changes:
    • The str.replace() method now allows the count argument to be a keyword.
    • The compiler strips indents from docstrings, reducing the size of bytecode caches.
    • The compile() built-in accepts a new flag ast.PyCF_OPTIMIZED_AST for optimized ASTs based on the optimize argument.
    • Changes in multiprocessing, concurrent.futures, and compileall modules related to CPU count handling.
    • os.path.realpath() can now resolve MS-DOS style filenames even if the file is not accessible.
    • A new environment variable PYTHON_FROZEN_MODULES was added.
  3. No New Modules Introduced: As of now, Python 3.13 does not include any new modules.

  4. Improved Modules:
    • Enhancements in the ast, array, asyncio, and copy modules, including new functionalities and optimizations like the new 'w' type code in array for Unicode strings and the copy.replace() function.
  5. Optimizations: The textwrap.indent() function is now approximately 30% faster for large inputs.

  6. Deprecated Features:
    • Deprecation of the 'u' format code in the array module and certain functions in the ctypes module.
    • Soft deprecation of the getopt and optparse modules in favor of argparse.
    • Deprecation of http.server.CGIHTTPRequestHandler due to security and functionality concerns.
  7. Pending Removals:
    • The type, choices, and metavar parameters of argparse.BooleanOptionalAction are scheduled for removal in Python 3.14.

These changes reflect Python’s ongoing evolution, focusing on optimization, modernization, and the removal of outdated components.

For full details of all the changes, refer to the official Python documentation

Did you find this content useful?

If you found this high quality content useful please consider supporting my work, so I can continue to create more content for you.

I give away all my content for free: Weekly video content on YouTube, 3d Printable designs, Programs and Code, Reviews and Project write-ups, but 98% of visitors don't give back, they simply read/watch, download and go. If everyone who reads or watches my content, who likes it, helps fund it just a little, my future would be more secure for years to come. A price of a cup of coffee is all I ask.

There are a couple of ways you can support my work financially:

If you can't afford to provide any financial support, you can also help me grow my influence by doing the following:

Thank you again for your support and helping me grow my hobby into a business I can sustain.
- Kevin McAleer