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.
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.
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”.
Legal headache deepens for TikTok in US, after a number of states file lawsuits alleging…
After HBO documentary names Canadian crypto expert Peter Todd as Bitcoin inventor – but he…
Supreme Court clears X to resume access in Brazil, after high profile clash between top…
US Department of Justice mulls asking judge to force Google to sell parts of its…
US Supreme Court declines to hear appeal from X, formerly Twitter, over nondisclosure order attached…
US federal judge orders Google to undertake wide range of measures allowing third-party app stores…