Microsoft has a conscience tool!

Microsoft released a new VS Code plug-in on July 1 called Pylance, a nod to Monty Python’s Lancelot.

With less than two days to go before the deadline, Pylance had 6,800 + VS Code plug-ins installed.

In 2018, Microsoft’s Python team released the Python Language Server, bringing Visual Studio’s rich Python IntelliSense support to VS Code.

To provide a better user experience, the team developed Pylance as a new language server based on Microsoft’s Pyright static type checking tool.

Pylance utilizes type stubs (.pyi files) and type inference to provide a high-performance development experience. Pylance enhances the Python IntelliSense experience with rich type information that helps you write better code faster. Pylance also provides fast and accurate auto-completion and type checking.

It’s also important to note that While Microsoft released Pylance, it didn’t open source Pylance.

Let’s take a look at the new VS Code plug-in!

Pylance

The installation

As with any VS Code plugin, you can simply click on the plugin marketplace icon in the sidebar and search for Pylance to install it.

Once installed, open a new.py file to use.

features

Like other Python servers, Pylance is optimized to improve development efficiency and experience with the following features:

  • Docstrings
  • Parameters of the tip
  • Automatic import
  • Code completion
  • The code in the diagnosis of
  • Reference and jump
  • Outline of the code
  • Type checking
  • Support for multiple workspaces
  • Signing help with type information
  • Compatible with IntelliCode and Jupyter Notebook

Instead of going through each of these features, I’ll pick a few that I personally think are good ones.

Docstrings

Reading class, method, and function documents is a common scenario in development, and Pylance provides an easy way to read the documents by hovering the mouse over the corresponding class, function, and method to display the corresponding string string documents.

Parameters of the tip

Pylance prompts detailed parameter information when calling a function, class, or method.

Automatic import

When using Pycharm, we can quickly import a package or module by pressing Alt+Enter. The same can be done with Pylance.

Code completion

Pylance, like most code completion tools, auto-completes code quickly and accurately.

The code in the diagnosis of

Pylance can diagnose Python code, highlighting code that does not conform to Python syntax. It is of great help to standardize coding and improve code quality.

Reference and jump

This is a very basic feature of the development process, so as a language server it is natural to support references and jumps.

Type checking

Type checking is turned off by default in Pylance and can be turned on in Settings if you are interested in Python type checking. Type checking includes two modes, one is mode or strict mode. This setting uses Pyright S type checking to apply a basic or comprehensive set of rules to your code, respectively. The diagnostics generated by this pattern can help improve code quality and help you find boundary cases more easily.

Support for multiple workspaces

Pylance supports multiple workspaces so that multiple folders can be opened in the same Visual Studio code session, with Pylance functionality in each folder.


Dry recommended

In order to facilitate everyone, I spent half a month’s time to get over the years to collect all kinds of iso technical finishing together, content including but not limited to, Python, machine learning, deep learning, computer vision, recommendation system, Linux, engineering, Java, content of up to 5 t +, I put all the resources download link to a document, The directory is as follows:

All dry goods to everyone, hope to be able to support it!

https://http://pan.baidu.com/s/1eks7CUyjbWQ3A7O9cmYljA (code: 0000)