DEV Community

Carlos V.
Carlos V.

Posted on

1

Exploring Pyright

Are you using Python type annotations? Having fun with mypy? Microsoft created some years ago yet another static type checker called Pyright.

GitHub logo microsoft / pyright

Static Type Checker for Python

Pyright

Static Type Checker for Python

Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases.

Pyright includes both a command-line tool and an extension for Visual Studio Code.

Documentation

Refer to the documentation for installation, configuration, and usage details.

Community

Do you have questions about Pyright or Python type annotations in general? Post your questions in the discussion section.

If you would like to report a bug or request an enhancement, file a new issue in either the pyright or pylance-release issue tracker. In general, core type checking functionality is associated with Pyright while language service functionality is associated with Pylance, but the same contributors monitor both repos. For best results, provide the information requested in the issue template.

Contributing

This project welcomes contributions and suggestions. For feature and complex bug fix contributions…

Some devs said it has a very great speed compared to mypy. I haven't used for any of my project's CI pipeline yet but I have this VSCode extension which, if you use this editor for your Python projects, you will be grateful on how it catches bugs caused by typing issues. So far it catches more issues than mypy and its messages are somehow clearer.

Being both VSCode and Pyright built with JavaScript (yes, Pyright was written in JS), their integration is pretty sweet. Although you can integrate to your favorite editor (vim, emacs, etc...).

The CLI is pretty similar to mypy. I'd suggest to give it a try and let me know how was your experience using it.

Wanna know how to start using type annotations in Python? Check out my tutorial published by Stack Builders.

👋 Kindness is contagious

Please leave your appreciation by commenting on this post!

It takes one minute and is worth it for your career.

Get started

Thank you!

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay