Updated Python support in VS Code brings browser editing and ditches open-source language server for Pylance

Proprietary code creep?


Microsoft has updated Python support in Visual Studio Code, introducing editing in a web browser. The company has also archived its open-source Python language server in favour of the closed-source Pylance.

The Python Extension has over 41 million installs, according to the stats, versus just over 3 million for a third-party Python extension, which uses pyLint or flake8 for the linter (both open source).

Language servers provide the engine that drives programming language-specific features in the VS Code editor, such as syntax highlighting, code completion, and error detection. Microsoft's first go at a Python language server was in 2018 and is open source.

Pylance was introduced in June 2020 (the name is based on Monty Python and the Holy Grail's Lancelot). Features include rich type information when hovering over code symbols, smart import suggestions, and type checking (which can optionally be set to strict).

The Python extension has over 41 million installs

The Python extension has over 41 million installs

Bad news for Python 2.7 coders: support for this, which used to be based on the open-source Jedi project, has been dropped. Official advice is to upgrade to Python 3 or to use Pylance and hope for the best. Some Python libraries only exist in 2.x versions so this can be a problem. It is still possible to use the Python 2.7 runtime for a project, but the smart code editor features will be unreliable.

Also new in this release, and using Pylance, is web-editing support. Web editing is VS Code implemented entirely in the browser, as seen in github.dev and in the announced and then unannounced Visual Studio Code for the Web.

Features that work in this context include semantic highlighting, syntax errors, code navigation with outline support, and function signature help. The web version is handy as it is zero install, though it can lead to an "uncanny valley" experience where it looks familiar but works slightly differently than desktop VS Code.

Python code in the github.dev editor

Python code in the github.dev editor

The VS Code Python extension has a revamped testing interface, according to Microsoft program manager Savannah Ostrowski, and also supports the built-in test explorer.

That said, there seem to be some initial issues with the new test support. One user reported after the update that "this morning running 40 tests took 3 seconds, now it's 40+ seconds," and another confirmed that "Unittest run all tests is extremely slow."

VS Code is one of the most popular editors among Python developers. The Python Developer Survey last year placed it second after JetBrains PyCharm (though note that JetBrains assisted with this survey which may lead to unintended bias) but only by 33 to 29 per cent. VS Code grew by 5 per cent from 2019, so if that is repeated it could be ahead soon.

Although VS Code is free and open source, one less appealing aspect of Pylance is that, unlike Microsoft's original Python Language Server, it is closed source. The licence for Pylance states that "you may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the 'Visual Studio Products and Services') to develop and test your applications."

In mitigation, Pylance is built on a separate project, Pyright, which provides static type checking for Python. Pyright is also a Microsoft project but is open source under the MIT Licence.

Language servers are so fundamental to VS Code that moving extensions like this is arguably undermining the open-source status of the editor, as well as making it harder for the community to fix issues and propose improvements – though there is no problem if the issue is in Pyright, or in the Python Extension itself, which are open source. ®

Similar topics

Broader topics


Other stories you might like

  • Despite global uncertainty, $500m hit doesn't rattle Nvidia execs
    CEO acknowledges impact of war, pandemic but says fundamentals ‘are really good’

    Nvidia is expecting a $500 million hit to its global datacenter and consumer business in the second quarter due to COVID lockdowns in China and Russia's invasion of Ukraine. Despite those and other macroeconomic concerns, executives are still optimistic about future prospects.

    "The full impact and duration of the war in Ukraine and COVID lockdowns in China is difficult to predict. However, the impact of our technology and our market opportunities remain unchanged," said Jensen Huang, Nvidia's CEO and co-founder, during the company's first-quarter earnings call.

    Those two statements might sound a little contradictory, including to some investors, particularly following the stock selloff yesterday after concerns over Russia and China prompted Nvidia to issue lower-than-expected guidance for second-quarter revenue.

    Continue reading
  • Another AI supercomputer from HPE: Champollion lands in France
    That's the second in a week following similar system in Munich also aimed at researchers

    HPE is lifting the lid on a new AI supercomputer – the second this week – aimed at building and training larger machine learning models to underpin research.

    Based at HPE's Center of Excellence in Grenoble, France, the new supercomputer is to be named Champollion after the French scholar who made advances in deciphering Egyptian hieroglyphs in the 19th century. It was built in partnership with Nvidia using AMD-based Apollo computer nodes fitted with Nvidia's A100 GPUs.

    Champollion brings together HPC and purpose-built AI technologies to train machine learning models at scale and unlock results faster, HPE said. HPE already provides HPC and AI resources from its Grenoble facilities for customers, and the broader research community to access, and said it plans to provide access to Champollion for scientists and engineers globally to accelerate testing of their AI models and research.

    Continue reading
  • Workday nearly doubles losses as waves of deals pushed back
    Figures disappoint analysts as SaaSy HR and finance application vendor navigates economic uncertainty

    HR and finance application vendor Workday's CEO, Aneel Bhusri, confirmed deal wins expected for the three-month period ending April 30 were being pushed back until later in 2022.

    The SaaS company boss was speaking as Workday recorded an operating loss of $72.8 million in its first quarter [PDF] of fiscal '23, nearly double the $38.3 million loss recorded for the same period a year earlier. Workday also saw revenue increase to $1.43 billion in the period, up 22 percent year-on-year.

    However, the company increased its revenue guidance for the full financial year. It said revenues would be between $5.537 billion and $5.557 billion, an increase of 22 percent on earlier estimates.

    Continue reading

Biting the hand that feeds IT © 1998–2022