dry-python / dry-python/returns

Kind of Kind

未关闭
#813 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
4.4k
派生
155
平均合并
2 小时 27 分钟
30 天内合并 PR
22

描述

# 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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。