This release includes the `try_` function, which is a combinator used to wrap other functions. It wraps said functions in such a way that, if they raise an exception, the wrapped function will return an `Err` containing that exception value. Otherwise, the result will be an `Ok` containing whatever the wrapped function returned.
This release also includes the `__enter__` and `__exit__` methods needed to make `Result` capable of being used in `with` blocks. The way it's implemented enables users to further avoid having to handle exceptions by virtue of being able to use `Result` in more places. Where you would have, prior to this release, had to write something like the following, even if you were using results just about everywhere else:
python
try:
with open('some_file', 'w') as f:
f.write('hello!')
except OSError:
print('something went wrong!')
you can now write:
python
with try_(open)('some_file', 'w') as result_f:
result_f.map(lambda writer: writer.write('hello!'))
Can ignore the possibility of an error if we want, or check with `result_f.is_err()` as expected