ELI5: Pyre – Quick Error Flagging for Giant Python Codebases

In this blog post we explain Pyre, a high-performance type checker for Python 3, in a way that is very easy to understand. If you’d like to learn by watching or listening, watch a video about this open source project on our Facebook Open Source YouTube channel.

Why pyre?

We love using Python on Facebook and Instagram, but when we’re working on code bases the size of ours, the lack of static guarantees can make it difficult to make changes safely. To meet this challenge, we developed Pyre, a static type checker designed to improve the quality of code and the development speed in large Python code bases.

Pyre is PEP 484 compatible and works in your favorite editor to automatically flag type errors. It’s optimized for near-instant responses, so you can get instant feedback even in a very large code base. Even if you are not fully committed to static typing, or have an existing code base that you want to gradually annotate over time, you can still get useful results.

Pysa is a security-oriented tool that builds on Pyre. We recommend using both for current or future projects that you create in Python. If you want to learn more about Pysa, check out our ELI5 from Jessica Lin.

Where is the pyre used?

Pyre was deployed as an open source solution in May 2018. We use it extensively to maintain the Facebook and Instagram codebases. In this video presentation, you will learn how Python types are used in Instagram codebases to learn more about what Python types look like and how they can make your codebase more secure.

Where can i learn more?

To learn more about Pyre, visit the website for documentation for developers who are just starting out or want to use more advanced features. The Getting Started with Pyre section provides resources for setting up a project, running Pyre, and joining the Pyre community. For more information on how to include your project in type testing, check out this video tutorial on our Facebook page for developers.

If you have any further questions about Pyre, please let us know on our YouTube channel or tweet us at. We always want to hear from you, and we hope you find this open source project and the new ELI5 series useful.

About the ELI5 series

In a series of short videos (around 1 minute long) one of our developer attorneys on the Facebook Open Source team explains a Facebook Open Source project in a way that is easy to understand and use.

For each of these videos we are writing an accompanying blog post (like the one you are reading right now) that you can find on our YouTube channel.

To learn more about Facebook Open Source, visit our Open Source website, subscribe to our YouTube channel, or follow us on Twitter and Facebook.

Would you like to work with open source on Facebook? Check out our open source related job postings on our careers page by taking this short survey.

Comments are closed.