dry-python / dry-python/returns
Unit method like `IOResultE.from_value` must return `IOResult[_V, Exception]` type
Open
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
Assessment
This issue has not been assessed yet.