result
A simple Rust like Result type for Python 3. Fully type annotated. (by rustedpy)
result
A TypeScript result type taking cues from Rust's Result and Haskell's Either types (by badrap)
result | result | |
---|---|---|
7 | 2 | |
1,363 | 276 | |
3.5% | 1.1% | |
8.1 | 3.9 | |
about 1 month ago | about 12 hours ago | |
Python | TypeScript | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
result
Posts with mentions or reviews of result.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-03-21.
-
Ask HN: Anyone looking for contributors for their open source projects
https://github.com/rustedpy/result
Small Python library, slowly and steadily growing in use.
-
Python errors as values: Comparing useful patterns from Rust and Go
The result package in the article: https://github.com/rustedpy/result
There's a pretty decent explanation in the readme. If you're more interested in Monads, I am not sure I'd cover that in a HN comment very well, but I would encourage you to take a look.
-
Blog post: Writing Python like it’s Rust
For the part "Writing Python like it's Rust", did you try the result package? I didn't (yet?) use it as I feel that if I push to use it at work, I will fall in the Rustacean caricature..
-
Rust-like error handling in Python with NamedTuple
Use the result package, if you want a proper, rusty result type. This approach is bad.
- A simple Rust-like Result type for Python
- Rust-like Result type for Python
result
Posts with mentions or reviews of result.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-11-09.
- Python errors as values: Comparing useful patterns from Rust and Go
-
I created a package that adds Rust-like features to TypeScript
I'm using https://github.com/badrap/result for this purpose right now. I'll have to take a closer look at the API to see how your library differs, but I skimmed through the README and it looked promising. Good stuff :)
What are some alternatives?
When comparing result and result you can also consider the following projects:
returns - Make your functions return something meaningful, typed, and safe!
neverthrow - Type-Safe Errors for JS & TypeScript
msgspec - A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
oxide.ts - Rust's Option<T> and Result<T, E>, implemented for TypeScript.
ts-results - A typescript implementation of Rust's Result object.
unwrapit - A graceful and intuitive way to handle errors in JS/TS.