dry-python / dry-python/returns

Kind of Kind

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

Description

# 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]]`.
kind

## System information

- `python` version: Python 3.9.1
- `returns` version: master:1fec2a8a79175da5afa39695e3ccc177c8c73ab7
- `mypy` version: mypy 0.800

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.