Categories: SoftwareWorkspace

Microsoft Claims Speed Edge With Open Source Python Type Checker

Microsoft has released Pyright, an open-source static type-checking tool for the Python programming language that it claims runs faster than other popular type-checkers such as Mypy.

Microsoft said the tool also runs faster than its own Python Language Server, which offers some overlapping features.

Pyright is written in Typescript and runs on Node.js, meaning it doesn’t require an existing Python runtime or imported third-party packages.

It’s intended for large Python source bases, and can be set up to perform fast incremental updates when files are modified.

Granular control

The tool supports flexible configuration, providing granular control over settings.

Users can set up different execution environments for different subsets of a source base, each of which can use different module search paths, Python language versions and target platforms.

Pyright supports features such as type hints, variable notation and structural subtyping.

It can be used as a Language Server Protocol plugin for Microsoft’s Visual Server Code source-code editor or can be run as a stand-alone command-line tool, Microsoft said.

It said Pyright typically runs five times faster than Python type checkers that are themselves written in Python, such as Mypy, Pytype and Pyre, whose speed is limited by that of Python itself.

Microsoft said some of Pyright’s features overlap with the Python Language Server offering, with the difference that Pyright is entirely focused on type checking, enabling it to offer more configurability, command-line execution and better performance.

Python 3.0 support

The tool is open source, with its code hosted on GitHub, and Microsoft provided a to-do list of unfinished features.

But it said only Python 3.0 and newer are supported, with no plans to support older versions.

Microsoft bought GitHub for $7.5 billion (£5.7bn) last year, after shuttering its own competing service, Codeplex, in 2017, saying GitHub had become the “de facto place for open source sharing”.

The move was a landmark shift for the company, which at one point had tried to discredit open source by characterising it as a “cancer”.

Matthew Broersma

Matt Broersma is a long standing tech freelance, who has worked for Ziff-Davis, ZDnet and other leading publications

Recent Posts

Uber To Pay $9m Settlement Over Safety Reporting Failure

Uber agrees to pay $9 million to settle dispute with California regulators over its failure…

22 mins ago

Didi Global To Delist From New York Stock Exchange

Chinese ride-hailing giant Didi Global to exit New York Stock Exchange only months after disastrous…

52 mins ago

Russia Seeks To Fine Google, Meta On Annual Turnover

Russian regulator applies to court to fine US tech giants percentage of annual Russian turnover,…

3 days ago

The Business of the Metaverse

Is Facebook’s vision of the Metaverse a realistic proposition for businesses? Silicon UK spoke to…

3 days ago