Microsoft Improves Python Support In VSCode
Written by Mike James   
Tuesday, 07 July 2020

Visual Studio Code has a new extension to improve Python support. Pylance adds fast, static type checking, autocomplete, and live type information about symbols among other features to the existing Python extension in VSCode. 

The new extension, Pylance, is a new language server for Python, which uses the Language Server Protocol to communicate with VS Code. The team says the name Pylance serves as a nod to Monty Python’s Lancelot, who is the first knight to answer the bridgekeeper’s questions in the Holy Grail.

pythonicon

Pylance is designed to improve the user experience. It's based on Microsoft’s Pyright static type checking tool. Pylance uses type stubs (.pyi files) and lazy type inferencing, and the developers say it "supercharges your Python IntelliSense experience with rich type information, helping you write better code, faster."

The team has also included a collection of type stubs for popular modules to provide fast and accurate auto-completions and type checking.

type checking in pylance

The type information support from Pylance can be accessed in function signatures and when hovering on symbols so you know you're invoking functions correctly. The new extension also adds auto-imports meaning developers get smart import suggestions in completions list for installed and standard library modules. Type checking diagnostics are also now supported, with the choice of applying either a basic or comprehensive set of rules over your codebase.

Pylance also has native support for multi-root workspaces, meaning that you can open multiple folders in the same Visual Studio Code session and have Pylance functionality in each folder.  If your project includes Jupyter notebooks, the extension works with those.

If you have the Python extension installed, you can try out Pylance by downloading the extension straight from the Visual Studio Code marketplace. The Python extension then recognizes that you’ve installed Pylance and prompts you to select it as your language server. If you are not already using the Python extension in VS Code, installing Pylance will fetch that extension as well. 

 

  • Mike James is the author of Programmer's Python: Everything is an Object published by I/O Press as part of the  I Programmer Library. With the subtitle "Something Completely Different" this is for those who want to understand the deeper logic in the approach that Python 3 takes to classes and objects.

 

 

pythonicon 

More Information

Pylance On Visual Studio Code Marketplace

Python Extension For Visual Code

Related Articles

Python In Visual Studio Code Improves Jupyter Support

Visual Studio Code Python Gets Data Science Kit

Visual Studio Python Gets AI-Based IntelliCode

Jupyter Notebook 5 Adds Cell Tagging

Jupyter 4 Completed By Release Of IPython 4 

IPython 5.0-LTS Released

Python Development Trends

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, Facebook or Linkedin.

Banner


Apache Arrow 2 Improves C++ and Rust Support
29/10/2020

There's a new release of Apache Arrow with improvements to the support for C++ and Rust, particularly in support for Parquet.



Lightstep Adds New GitHub Action
22/10/2020

Lightstep has announced a new GitHub action, Lightstep Pre-Deploy Check, designed to help developers be proactive about ensuring the quality and performance of their software before it’s actually de [ ... ]


More News

square

 



 

Comments




or email your comment to: comments@i-programmer.info

<ASIN:1871962587>

<ASIN:B07S1K8KLW>

Last Updated ( Tuesday, 07 July 2020 )