Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typing hints #107

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

user-11150
Copy link
Contributor

Add typing hints (mypy strict mode)

@gaogaotiantian
Copy link
Owner

Sorry I did not have the time to check this. I was moving. Currently there's no plan to use the strict mode. However, some of the additions to the missing signatures are okay. Also in this PR do not change Type to type because that is deprecated in 3.9 and 3.8 is still alive (for a little bit). If Type is to be replaced, we should replace all the Dict and List etc.

So could you remove the strict check and leave only the additions to the signature types?

@user-11150
Copy link
Contributor Author

如果把DictList替换成builtins的dict和list,低于3.9的你打算怎么支持

@gaogaotiantian
Copy link
Owner

Also in this PR do not change Type to type

我的意思是不要这么干。

@user-11150
Copy link
Contributor Author

哦,抱歉误解了

@user-11150
Copy link
Contributor Author

我是不是还需要重新fork一下你的仓库

@user-11150
Copy link
Contributor Author

拉一个新的PR

@gaogaotiantian
Copy link
Owner

不用。你不应该在你的master上直接做修改……我建议你去看一下git的工作流程,可能对你有帮助。对于这个PR,你可以直接在你的branch上push新的commit。

@user-11150
Copy link
Contributor Author

我改了一下,你看看可以吗

@user-11150
Copy link
Contributor Author

不用。你不应该在你的master上直接做修改……我建议你去看一下git的工作流程,可能对你有帮助。对于这个PR,你可以直接在你的branch上push新的commit。

【十分钟学会正确的github工作流,和开源作者们使用同一套流程-哔哩哔哩】 https://b23.tv/1V1kgFN

你说的是这个视频吗?

@gaogaotiantian
Copy link
Owner

是,你需要熟悉一下github的操作。

对于这个PR,在这个PR里,只做一件事,就是把没有标注的类型补全。所以不要加--strict,不要去给Type做generic,包括其他的类型的generic都先不要做。你加的很可能是正确的,但是这不一定会让代码更好读。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants