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

Python 类的 6 种替代方案 #8202

Merged
merged 7 commits into from
Mar 15, 2021
Merged

Python 类的 6 种替代方案 #8202

merged 7 commits into from
Mar 15, 2021

Conversation

Alfxjx
Copy link
Contributor

@Alfxjx Alfxjx commented Mar 12, 2021

译文翻译完成,resolve #8144
第一次尝试 python 文章,大大们帮偶狠狠挑挑刺

@lsvih lsvih changed the title 6 alternatives to classes in python Python 类的 6 种替代方案 Mar 12, 2021
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
@@ -109,15 +109,15 @@ def get_distance(p1: Dict[str, Any],
pass
```

The annotation in practice is really bad. It’s almost always `Dict[str, Any]` in the best case. Often, there is no annotation.
在实际中,注解确实很糟糕,字典的注解在多数情况下几乎总是 `Dict[str, Any]` 。通常,没有注解。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
在实际中,注解确实很糟糕,字典的注解在多数情况下几乎总是 `Dict[str, Any]` 。通常,没有注解
在实际中,注解确实很糟糕。通常来说几乎没有字典的注解,而一般来说,最佳的注解会是 `Dict[str, Any]`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 best 可以看看这个链接,我觉得属于是第三个意思 绝大多数情况,因为 Dict[str, Any] 这个注解属于不好的注解,包含了所有的类型。
可以改成:
在实际中,注解确实很糟糕。通常来说几乎没有字典的注解,在大部分情况下的注解会是 Dict[str, Any]

article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
@ninn-kou
Copy link
Contributor

@Alfxjx @lsvih 校对认领。

@lsvih
Copy link
Member

lsvih commented Mar 13, 2021

@flying-yogurt 欢迎校对

Copy link
Contributor

@ninn-kou ninn-kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alfxjx @lsvih 校对完成。

article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
article/2021/6-alternatives-to-classes-in-python.md Outdated Show resolved Hide resolved
Co-authored-by: Hao Ren <haoren.2906@gmail.com>
Co-authored-by: Hoarfroster <penguin.zhang@qq.com>
@lsvih
Copy link
Member

lsvih commented Mar 15, 2021

@Alfxjx 麻烦添加一下译者和校对者信息哈

@Alfxjx
Copy link
Contributor Author

Alfxjx commented Mar 15, 2021

@PassionPenguin @flying-yogurt 感谢校对 已经修改啦
@lsvih 译者和校对者信息也添加了

@lsvih lsvih merged commit c2865c5 into xitu:master Mar 15, 2021
@lsvih
Copy link
Member

lsvih commented Mar 15, 2021

@Alfxjx 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

@Alfxjx
Copy link
Contributor Author

Alfxjx commented Mar 15, 2021

@Alfxjx 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

https://juejin.cn/post/6939715051779522591/ 已经发布到掘金啦

@lsvih
Copy link
Member

lsvih commented Mar 15, 2021

@Alfxjx 收到

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

Successfully merging this pull request may close these issues.

Python 类的 6 种替代方案
4 participants