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:
-
Deprecations and Removals: Python 3.13 removes 19 βdead batteriesβ from the standard library, including modules like
cgi,cgitb,msilib, andtelnetlib, as part of PEP 594. - 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 flagast.PyCF_OPTIMIZED_ASTfor optimized ASTs based on the optimize argument. - Changes in
multiprocessing,concurrent.futures, andcompileallmodules 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_MODULESwas added.
- The
-
No New Modules Introduced: As of now, Python 3.13 does not include any new modules.
- Improved Modules:
- Enhancements in the
ast,array,asyncio, andcopymodules, including new functionalities and optimizations like the new'w'type code inarrayfor Unicode strings and thecopy.replace()function.
- Enhancements in the
-
Optimizations: The
textwrap.indent()function is now approximately 30% faster for large inputs. - Deprecated Features:
- Deprecation of the
'u'format code in thearraymodule and certain functions in thectypesmodule. - Soft deprecation of the
getoptandoptparsemodules in favor ofargparse. - Deprecation of
http.server.CGIHTTPRequestHandlerdue to security and functionality concerns.
- Deprecation of the
- Pending Removals:
- The type, choices, and metavar parameters of
argparse.BooleanOptionalActionare scheduled for removal in Python 3.14.
- The type, choices, and metavar parameters of
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 https://docs.python.org/3.13/whatsnew/3.13.html
Comments