Python 3.12 – A quality upgrade with many desirable features!

As a programmer, in recent days you have surely become familiar with the information surrounding the new feature update version of Python 3.12. Is this an upgrade worthy of users’ expectations? The article below will provide a lot of noteworthy information!

1/ What is Python 3.12?

Every year, new versions of the Python programming language are released on a set timetable, beginning with a beta release (feature lock) in the first part of the year and ending with a final release.

Well, Python 3.12 was recently published, and most developers are urged to test it on non-production code. Using the beta phase both directly checks performance and demonstrates if developers will benefit from the new feature sets. Here are the most interesting Python 3.12 improvements for Python programmers to consider.

What is Python 3.12

Python’s feature upgrade (Source: Geeky Gadgets)

Python is a general-purpose language, which means it is very flexible and can be used to program many different types of functions. Because it is an “interpreted” language, it eliminates the need to compile code before executing it, and because it is a high-level programming language, Python can abstract details from the code. In fact, Python focuses so much on abstraction that most novice programmers can understand its code.

Related Article

5 Promising Programming Languages for AI and Machine Learning
5 Promising Programming Languages for AI and Machine Learning

Artificial Intelligence (AI) and Machine Learning (ML) are highly prioritized fields in Vietnam as well as in many developed countries around the world. If you are interested in these fields, there ar...

Python code tends to be simple, and when compared to compiled languages ​​such as C and C++, it executes programs more slowly. Its user-friendliness makes it a popular language for citizen developers working with machine learning algorithms in no-code software applications.

2/ What are the changes in Python 3.12?

What are the changes in Python 3.12

Significant updates on Python 3.12 (Source: LinkedIn)

  • Grammar feature:

Python 3.12 improves f-string syntax, enabling for more complicated expressions. Furthermore, inline comprehensions offer a more efficient way to manage comprehensions.

  • Typing improvements:

The language now supports buffer protocol access, accurate **kwargs typing with TypedDict, and overriding Decorators for static typing.

  • Removing Inappropriate APIs:

Developers have removed obsolete Unicode APIs and distutils packages to make way for more current tools and methodologies.

  • Error messages:

Enhanced error messages now include detailed feedback, recommending appropriate modules from the standard library in NameError situations and providing suggestions in ImportError errors.

Related Article

What is Python used for? Information that programmers should find out.
What is Python used for? Information that programmers should find out.

Python is a general-purpose object-oriented programming language created by Guido van Rossum that can be used for a variety of different types of programming. Today, every time users mention the most...

 

  • Module enhancements:

Many standard library modules, including asyncio, pathlib, and json, have been significantly updated.

  • Optimizations:

Python 3.12 makes improvements to the CPython bytecode to ensure efficient execution.

  • CPython API changes:

The version eliminates legacy Unicode APIs based on the Py_UNICODE* representation and makes improvements to the argument parsing capabilities.

3/ Should Python 3.12 be updated?

The most intriguing new features and enhancements in Python 3.12 were highlighted in the review’s above section. The next issue is whether they should update to the new version, and if so, when?

Of course, the answer to the preceding question is contingent on the requirements and nature of each employment. However, a tiny idea is to install Python 3.12 with your existing system. This enables you to begin testing new features while conducting local development.

Testing has the benefit of posing low risk, since any new feature is likely to have limited efficacy. At the same time, you may benefit from better error messages and interpreter improvements.

Should Python 3.12 be updated

Superiority of Python 3.12 (Source: CloudBytes/Dev)

It is recommended that users exercise particular caution while changing any work equipment under their control, since the repercussions might be quite problematic. Every new version of Python is thoroughly tested in beta. Still, it’s generally best to hold off on switching until after the initial changes have been implemented. Users might also want to give Python version 3.12.3, which was just issued by the publisher, a try.

Furthermore, customers that upgrade to Python 3.12 may encounter issues if they depend on other libraries that are not compatible with the latest version. Packages with C extensions in particular need to be specially optimized for version 3.12, which will take more effort.

Related Article

Basic understandings of web service development
Basic understandings of web service development

Web Service is seen as a technology that brings a revolution to B2B (Business to Business) and B2C (Business to Customer) services. The basic value of Web service development is based on providing sta...

As more and more package maintainers update their packages before to the final release, the publisher does guarantee that this issue will not arise as frequently as it has in the past.

You are not allowed to utilize the new type variable syntax or the enhancements to f-strings if you are maintaining a library that must support previous versions of Python. Code that is compatible with previous versions must be used.

Furthermore, if the user is creating an application, you have control over the platform that the application runs on. In this scenario, they can begin utilizing the new syntax by upgrading to Python 3.12.

4 / How to install Python 3.12?

How to install python

Update version 3.12 for Python according to APT (Source: Real Python)

There are many ways for users to update to the new version of Python, but this article discusses the simplest and fastest method. The specific instructions below will help users install Python 3.12 using APT in one fell swoop:

  • Step 1: Install prerequisites for adding custom PPA:

# apt install software-properties-common -y"

  • Step 2: Then go ahead and add the deadsnakes PPA to the APT package manager’s sources list:

"# add-apt-repository ppa:deadsnakes/ppa"

  • Step 3: Click Enter to continue. After installing the repository, run an APT update to make sure that the newly imported PPA is responsive.

"# apt update"

  • Step 4: You can now install Python 3.12 with the following command:

"# apt install python3.12"

  • Step 5: Verify installation and build version of Python 3.12 via the following command:

"#python3.12 --version

3.12.0″

  • Step 6: Install PIP, please do:

# curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12"

  • Step 7: Check PIP for Python 3.12 version:
"# pip3.12 -V
pip 23.2.1 from /usr/local/lib/python3.12/site-packages/pip (python 3.12)"

Related Article

GameFi Common Terms You Can't Miss
GameFi Common Terms You Can't Miss

One of the hottest topics in the cryptocurrency industry during the second half of 2021 so far is GameFi. If you are a newbie and are about to enter this hot and potential market. Do not ignore the co...

5. Conclusion

In short, the above article has compiled necessary information for users about the new version of Python 3.12. Although just released, Python 3.12 has shown many quality improvements that promise to provide great support for programmers. However, to ensure Python 3.12 can operate smoothly on your platform, please consider carefully before updating.