Nyakku Shigure
8 posts


@hd_nvim There are many stdlib and popular third-party libaries at typeshed (github.com/python/typeshed) that might be helpful.
English

@hd_nvim Such as Unpack? You can find it from typing_extensions (pypi.org/project/typing…) before Python 3.11.
If you want to support Python 3.8, you just need `from typing_extensions import Unpack`. Of course, you need add it to dependencies.
English

@hd_nvim 主要还是 Python 类型系统发展的太缓慢了,也许 PEP 729 peps.python.org/pep-0729/ 通过后能有所改善……
中文

@hd_nvim 是这个嘛😂?本来我也想说可以写这样一个函数的,不过如果是 API 的话好像也没什么好的办法,目前 Python 社区公认做法应该就是用 assert 来解决了(确实很麻烦),倒是有个上古的 PEP 505 peps.python.org/pep-0505/ 对类似场景可能有少许改进,但是一直没有进展(Deferred)

中文



