dry-python / dry-python/returns
Kind of Kind
- Vorherrschende Sprache
- Python
- Sterne
- 4.4k
- Forks
- 155
- Ø Merge
- 2 Std. 27 Min.
- Gemergte PRs (30 T.)
- 22
Beschreibung
# Bug report
## What's wrong
I would like to do
```python
from __future__ import annotations
from typing import TypeVar
from returns.primitives.hkt import Kind1, Kind2
class Alphabet:
pass
_A = TypeVar("_A", bound=Alphabet)
class State(Kind1["State", _A]):
pass
_S = TypeVar("_S", bound=State)
class Step(Kind2["Step", _A, _S]):
def foo(self, step: Step[_A, Kind1[_S, _A]]): # mypy error
del step
del self
pass
```
Such that the `step` parameter of `Step.foo` has the type-hint `Step[_A, _S[_A]]`.

## System information
- `python` version: Python 3.9.1
- `returns` version: master:1fec2a8a79175da5afa39695e3ccc177c8c73ab7
- `mypy` version: mypy 0.800
Beitragsleitfaden
Rechercherichtung
Beginne in returns.primitives.hkt, konzentriere dich auf Kind1 und Kind2 und reproduziere das Beispiel mit Python 3.9.1 und mypy 0.800. Als erledigt gilt es, wenn die Step.foo-Annotation Step[_A, _S[_A]] ohne einen mypy-Fehler ausdrücken kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100