fix(result): p.Result DIP without lazy FlextResult in _result - #366
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThe PR changes ChangesResult typing alignment
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Summary
FlextResultimports from_result/*.pyp.Result(DIP); construct viacls(...)r[T]concrete via TYPE_CHECKING stubs onFlextResultTest plan
make check CHECK_GATES=lint,format,pyrefly,mypy,pyright PROJECT=flext-core(exit 0)Bead: mro-bn0q.1
Summary by cubic
Fixes result typing regressions by removing lazy
FlextResultimports from_result/*and switching factories/transforms/composition to the abstractp.Resultprotocol. Keeps the publicr[T]facade intact and aligns with mro-bn0q.1.Bug Fixes
FlextResultimports in_result/*to prevent import cycles and mypy/pyright issues.p.Resultpayload invariant to match usage and avoid unsound variance.Refactors
p.Resultand construct viacls(...)only.TYPE_CHECKINGstubs sor[T]stays concrete; introduced checks viaFlextResultBaseforsuccessful_result/failed_result.cast(...)where needed and updated tests to annotate withp.Result[T].Written for commit 56d7675. Summary will update on new commits.
Summary by CodeRabbit
Improvements
Resultcontract.Tests