PYTHON Official Tutorial: Python3.11 Chinese Version Documentation

Python releases a new version every year, a feature-locked beta version in the first half of the year, and a final version at the end of the year.

The feature set of Python 3.11 has just been finalized, and a beta version has been released. Developers can try this latest version on non-production code, verify that it can work in your program, and understand whether your program can benefit from this performance increase. benefit from.

3.11 speed up

In Python 3.11, there are many individual performance improvements, the biggest one is the adaptive interpreter, since the type of the object rarely changes, the interpreter now tries to analyze the running code and replace the regular bytecode. For example, binary operations (addition, subtraction, etc.) can be replaced with special versions for integers, floats, and strings.

Python function calls also require less overhead in Python 3.11, and the stack used for function calls uses less memory and is designed to be more efficient. Also, while recursive calls do not have tail optimization (which is impossible in Python), they are more efficient than previous versions, and the Python interpreter itself is faster to start up, store and load the core modules needed at runtime It is also more efficient.

According to the official Python benchmark suite, Python 3.11 runs 1.25 times faster than 3.10. Note that this speed boost is an aggregate measure, some things are much faster, but many others are only slightly faster or about the same. These improvements are unlimited, and you don't need to make any changes to the original Python program to enjoy the speed improvement of 3.11.

Enhanced error messages

Another useful feature in Python 3.11 is more detailed error messages, and Python 3.10 already has better error reporting thanks to the use of a new analyzer in the interpreter. Now, Python 3.11 extends this by providing detailed feedback on which specific part of a given expression caused the error.

Another very useful feature in 3.11 is more detailed error messages, Python 3.10 already has better error reporting thanks to the new parser used in the interpreter. Now, Python 3.11 extends this to provide detailed feedback on which specific part of a given expression caused an error.

Python 3.11 Chinese Documentation is a complete set of the latest official Python textbook, including introductory tutorials, standard library references, Python/C API interfaces, language references, etc. Friends who need it are welcome to download!

Contents include:

  • New changes in Python 3.11 version

  • Getting Started Tutorial

  • Standard Library Reference

  • language reference

  • Install and use Python

  • Python Common Guidelines

  • Install Python modules

  • Distributing Python modules

  • Extend and Embed

  • Python/C API interface

  • common problem

The above official documents have been sorted out. If you need it, you can get it from GZH below. I hope it can help everyone!

Guess you like

Origin blog.csdn.net/weixin_49889351/article/details/128833079