Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add expected caster to Union #3135

Merged
merged 1 commit into from
Jan 17, 2024
Merged

Conversation

AntoinePrv
Copy link
Member

Cast tl::expected<T, E> to a union of either T or E.
This is lesser effort that could later be enriched with method of and_then, value...

Even if the type may be unconventional in Python, casting it has several advatanges over throwing
exceptions.

  • Exception remains for expceptional cases and are not used for general control flow,
  • The API is closer to libmamba's,
  • It dimishes the glue code required to bind functions (as well as possible erorrs).

@AntoinePrv
Copy link
Member Author

Does not interfere with micromamba tests.

@AntoinePrv AntoinePrv merged commit cc95098 into mamba-org:main Jan 17, 2024
21 checks passed
@AntoinePrv AntoinePrv deleted the expected-caster branch January 17, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants