Re

Resilient-result – Rust-style errors in Python

Hacker News

Resilient-result – Rust-style errors in Python

I built `resilient-result` after getting tired of try/catch blocks scattered everywhere in production Python code. It's a zero-dependency library that brings Rust-style Result types to Python with a clean decorator API and seamless async support. Key features: - @resilient decorator converts any sync or async function to return Result[T, E] instead of raising exceptions - Rust-style Ok() and Err() constructors for familiarity - Guard clause patterns for clean early returns - Full generic typing support for IDEs and type-checkers - Zero dependencies, Python 3.8+ Example: from resilient_result import Result, resilient @resilient def divide(a: int, b: int) -> int: return a // b result = divide(10, 0) # Returns Result.fail("division by zero") if result.success: print(f"Result: {result.data}") else: print(f"Error: {result.error}") The guard clause pattern shines in multi-step processes: def multi_step_process(data: str) -> Result[str, str]: step1_result = process_step1(data) if not step1_result.success: return step1_result # Early return on failure step2_result = process_step2(step1_result.data) if not step2_result.success: return step2_result return Result.ok(step2_result.data + "_complete") PyPI: https://pypi.org/project/resilient-result/ GitHub: https://github.com/iteebz/resilient-result Would love feedback from the community! Is this a pattern you'd use in production Python?

Share card

Actual performance

1points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
66%66% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
39%39% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: ide, io · Missing: https docs, excited, just released
38%38% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
29%29% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: code · Missing: mac, agents, macos
22%22% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
21%21% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Ru
Rust (PyO3) deserializer callable from Python55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Rust (PyO3) deserializer callable from Python

Hacker News1
Fl
FlashText with Rust for Python70%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

FlashText with Rust for Python

Hacker News6
Ca
Cargo-pup – ArchUnit-style linting for rust52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cargo-pup – ArchUnit-style linting for rust

Hacker News2
Ru
Rust-Like Traits in Python60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Rust-Like Traits in Python

Hacker News50
(2
(29x faster)Rapidvalidators - Python's validators lib rewritten in Rust49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

(29x faster)Rapidvalidators - Python's validators lib rewritten in Rust

Hacker News2
Ai
Aiochan – Golang-Style Concurrency for Python61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Aiochan – Golang-Style Concurrency for Python

Hacker News2
Ge
Genotype: language that compiles to idiomatic TS, Rust and Python62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Genotype: language that compiles to idiomatic TS, Rust and Python

Hacker News9
Ka
Kana.rs: A Tiny Rust NeuralNet for Python54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Kana.rs: A Tiny Rust NeuralNet for Python

Hacker News1
Pe
Performant Rust Streaming Algorithms from Python60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Performant Rust Streaming Algorithms from Python

Hacker News7
Ca
Cannoli – A compiler for a subset of Python written in Rust71%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cannoli – A compiler for a subset of Python written in Rust

Hacker News292