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

Meta Declines On Heavy AI Spending Plans, Despite Strong Q1

Share price hit after Meta admits heavy AI spending plans, after posting strong first quarter…

16 hours ago

Google Delays Removal Of Third-Party Cookies, Again

For third time Google delays phase-out of third-party Chrome cookies after pushback from industry and…

17 hours ago

Tesla Posts Biggest Revenue Drop Since 2012

Elon Musk firm touts cheaper EV models, as profits slump over 50 percent in the…

18 hours ago

Apple iPhone Q1 Sales In China Fall 19 Percent, Says Counterpoint

Bad news for Tim Cook, as Counterpoint records 19 percent fall in iPhone sales in…

21 hours ago

President Biden Signs TikTok Ban Or Divest Bill Into Law

TikTok pledges to challenge 'unconstitutional' US ban in the courts, after President Joe Biden signs…

23 hours ago