Closed RomanMIzulin closed 1 month ago
maybe add more tests
additional func witch do partition and unwraping?
not additional, but the only one. there's no problem in writing a for
loop to partinion based on is_succesful
finally some working code
can't understand why IOResult unwrapped to int instead of IO[int]
E pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output:
E Actual:
E main:7: note: Revealed type is "Tuple[builtins.list[builtins.int], builtins.list[Any]]" (diff)
E Expected:
E main:7: note: Revealed type is "Tuple[builtins.list[IO[builtin.int]], builtins.list[IO[builtin.int]]" (diff)
E Alignment of first line difference:
E E: ... "Tuple[builtins.list[IO[builtin.int]], builtins.list[IO[builtin.int]...
E A: ... "Tuple[builtins.list[builtins.int], builtins.list[Any]]"...
Because we used an incorrect interface 🤦 Sorry!
We need this one: https://github.com/dry-python/returns/blob/master/returns/interfaces/specific/result.py#L71
used that, seems like working, got from unwrap_or_failure func
https://github.com/RomanMIzulin/returns/blob/7b37a0fd171bc6b4e8fb62daf97736cddc002617/returns/interfaces/unwrappable.py#L10
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
82ef3ef
) to head (edf92e1
). Report is 127 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I have added partition func to result module
Checklist
CHANGELOG.md
Related issues
🙏 Please, if you or your company finds
dry-python
valuable, help us sustain the project by sponsoring it transparently on https://github.com/sponsors/dry-python. As a thank you, your profile/company logo will be added to our main README which receives hundreds of unique visitors per day.