facebook / facebook/pyrefly

Add integrated support for rustshed

Open
#4,221 2 comments 0 reactions 0 assignees View on GitHub
needs-discussion typechecking
Dominant language
Rust
Stars
7k
Forks
519
PR merge metrics
No merged PRs in 30d

Description

[rustshed](https://github.com/pawelrubin/rustshed) is a handy python library adding commonly used types from rust, like `Result` and `Option`. These are super useful to write code in the errors-as-values pattern rather than the more conventional try-except pattern in Python.

Unlike try-except, the errors-as-values pattern can be statically analyzed to find exactly where errors are left unhandled. If pyrefly can identify, for example, where a `Result` type is unchecked, that would be huge. This can be done with a pylint plugin, but it would be cool if it were integrated directly into the type-checker.

If the maintainers agree this is valuable, I would be happy to implement this myself.

Contributor guide

Open the contributing guide

Research direction

The issue names rustshed and Pyrefly but no files, tests, or entry points. Start by reading how Pyrefly represents Python types and how rustshed defines Result and Option, then clarify how unchecked values should be detected. Done requires an agreed integration design and type-checker behavior for unhandled errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
compilers, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.