dry-python / dry-python/returns

Unit method like `IOResultE.from_value` must return `IOResult[_V, Exception]` type

Open
#407 9 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Python
Stars
4.4k
Forks
155
Avg merge
2h 27m
Merged PRs (30d)
22

Description

Currently, they do return incorrect types:

```python
reveal_type(IOResultE.from_value(int))
# => IOResult[int, Any]

# Should be:
# => IOResult[int, Exception]
```

To achieve what we want we might tweak the way we create an alias in some way:
1. We can use inheritance instead of aliasing
2. We can use some magic
3. mypy plugin?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.