ClickSkills Logo
QUIZZESCOURSESWEBINARSWORKSHOPSCHATBOT
Article

What's new in Python 3.12

Like

Comment

What's new in Python 3.12

Annually, the Python programming language introduces new versions. The first half of the year usually sees a beta release with feature-locked improvements, while the final release comes out by year-end.

Python 3.12 is the latest addition to the Python family. Developers are urged to test this version with non-critical code to check its compatibility and explore new features and performance upgrades.

Let's dive into the key improvements in Python 3.12 that will interest Python developers:

Enhanced Error Messages

Over time, Python has made error messages increasingly accurate and informative. Python 3.12 takes this a step further by:

More Flexible F-strings

F-strings in Python used to have many restrictions, which Python 3.12 largely eliminates. Changes include:

Linux perf Profiler Integration

While the Linux perf profiler could always work with Python, it only provided C-level insights. Python 3.12 allows perf to collect Python-specific data through an opt-in feature, enabled either at the environment level or within the Python code using

sys.activate_stack_trampoline.

Improved Debugging and Profiling Speed

Debuggers and profilers tend to slow down code execution. PEP 669 introduces hooks for events like function starts and ends, allowing for more efficient monitoring.

Buffer Protocol Updates

Python 3.12 adds new special methods that allow Python code to interface directly with the buffer protocol, facilitating easier manipulation of data buffers.

Advances in Type Hinting

Python's type-hinting system continues to evolve. Python 3.12 introduces:

Incremental Performance Gains

Though Python 3.12 doesn't bring groundbreaking performance improvements, it does offer:

Preliminary Subinterpreter Support

Python 3.12 lays the groundwork for subinterpreters but lacks an end-user interface for them. This functionality is expected to arrive in Python 3.13.

Refinements in Garbage Collection

Previously, Python's garbage collection could activate any time an object was allocated. In Python 3.12, garbage collection is triggered only during the "eval breaker" phase in the Python bytecode loop, which occurs between the execution of one bytecode and the next. The garbage collection process also activates whenever the CPython signal-handler-checking mechanism is called. This new approach allows garbage collection to run intermittently even during a long-lasting call to a C extension that's outside the runtime, enhancing the efficiency of memory management.

Other Updates

Python 3.12 also brings:

Feel free to test Python 3.12 and explore these enhancements!

Comments

0

No comments yet

Be the first to share your thoughts on this article

About the Author

P

Prathamesh Sakhadeo

Expert content creator and educator at ClickSkills, passionate about sharing knowledge and helping learners achieve their goals.

Article Info

Read Time

2 min read

Views

0

Likes

0

Published

Oct 14, 2025

Share this Article

Quick Actions

Browse All ArticlesExplore Courses

Resources

For TutorsFor StudentsBlogInstructors

Associations

AIC RMP
Startup India
SciTech

Subscribe

Email us: support@clickskills.in

Call us: 9 00 11 55 44 6

© 2026 ClickSkills EdTech Pvt Ltd


Disclaimer: All trademarks, logos, and brand names used on this website belong to their respective owners. We do not claim any ownership or affiliation unless stated otherwise.