rustedpy / maybe

A simple Rust like Option type for Python 3. Fully type annotated.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement `as_maybe` and `as_async_maybe`

francium opened this issue · comments

We may need to think about if the semantics differ in the context of a Maybe vs a Result

I think this will be great but as I understand it will be only handling None or Values, it does not have anything to do with Exceptions right? I can also help implementing this if required

Hi demetere, no nothing to do with exceptions. I don't think they make sense in this context since we're dealing with optional values here. The use case we're covering here is converting a function like this def foo(...) -> Optional[T] into def foo(...) -> Maybe[T]

If you're interested in helping out, please do feel free to take this on. Refer to the as_result implementation in the Result repo as a starting point.

Thanks