dry-python / dry-python/returns

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

Aperta
#407 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug help wanted
Lingua principale
Python
Stelle
4.4k
Fork
155
Merge medio
2h 27m
PR unite (30g)
22

Descrizione

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?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.