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”.
After relocating from California to Texas in 2020, Oracle's Larry Ellison now reveals plan to…
Share price hit after Meta admits heavy AI spending plans, after posting strong first quarter…
For third time Google delays phase-out of third-party Chrome cookies after pushback from industry and…
Elon Musk firm touts cheaper EV models, as profits slump over 50 percent in the…
Bad news for Tim Cook, as Counterpoint records 19 percent fall in iPhone sales in…
TikTok pledges to challenge 'unconstitutional' US ban in the courts, after President Joe Biden signs…