Menu
Microsoft unveils Pylance, a new Python extension for Visual Studio Code

Microsoft unveils Pylance, a new Python extension for Visual Studio Code

Pylance works with the existing Microsoft Python extension to bring faster type checking and program analysis to Python devs

Credit: Dreamstime

Microsoft has pulled back the drapes on Pylance, a Visual Studio Code extension for faster and more complete Python language support in that popular code editor.

Pylance doesn't replace the existing Microsoft-authored Python extension for Visual Studio Code, which has some 21 million installations to its name.

Instead, Pylance expands on the existing Python extension to provide fast, static type checking (using Microsoft's Pyright project), live type information about symbols, autocomplete, auto-imports, code outlining and navigation, and other tools for Python development.

Pylance works with Jupyter notebooks, when those are in use in a project. It can also use custom type stubs from a project directory with the python.analysis.stubPaths option. It's also possible for workspaces, users, or projects to customise which errors get flagged on a codebase and what level of severity to assign them.

For instance, if you have a lot of code that creates variables conditionally, and which you know doesn't create issues, you can disable the reportUnboundVariable option to avoid flagging such code.

When the auto-imports feature is enabled, it automatically inserts appropriate imports for libraries recognised in Pylance's search path. If you type gc.disable() for instance, Pylance will infer that you are referring to the gc module in the standard library, and automatically add import gc as needed at the top of your project.

For the most part, Pylance should work as-is with existing projects, but it may need some special configuration in a couple of cases.

For example, if Pylance flags imports in a project and claims they can't be found, you may need to customise Pylance's search path for the project by adding the python.analysis.extraPaths attribute in settings.json.


Follow Us

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags Microsoftpython

Events

Featured

Slideshows

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners

This year’s Reseller News 30 Under 30 Tech Awards were held as an integral part of the first entirely virtual Emerging Leaders​ forum, an annual event dedicated to identifying, educating and showcasing the New Zealand technology market’s rising stars. The 30 Under 30 Tech Awards 2020 recognised the outstanding achievements and business excellence of 30 talented individuals​, across both young leaders and those just starting out. In this slideshow, Reseller News honours this year's winners and captures their thoughts about how their ideas of leadership have changed over time.​

Meet the Reseller News 30 Under 30 Tech Awards 2020 winners
Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security

Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security

This exclusive Reseller News Exchange event in Auckland explored the challenges facing the partner community on the cloud security frontier, as well as market trends, customer priorities and how the channel can capitalise on the opportunities available. In association with Arrow, Bitdefender, Exclusive Networks, Fortinet and Palo Alto Networks. Photos by Gino Demeer.

Reseller News Exchange Auckland: Beyond the myths — how partners can master cloud security
Reseller News welcomes industry figures at 2020 Hall of Fame lunch

Reseller News welcomes industry figures at 2020 Hall of Fame lunch

Reseller News welcomed 2019 inductees - Leanne Buer, Ross Jenkins and Terry Dunn - to the fourth running of the Reseller News Hall of Fame lunch, held at the French Cafe in Auckland. The inductees discussed the changing face of the IT channel ecosystem in New Zealand and what it means to be a Reseller News Hall of Fame inductee. Photos by Gino Demeer.

Reseller News welcomes industry figures at 2020 Hall of Fame lunch
Show Comments