Skip to content

生成 "operator ==" 和 "hashCode" 方法 #19

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

TshineZheng
Copy link

@TshineZheng TshineZheng commented Feb 21, 2019

在开发中,生成的代码有时候直接拿来当做程序中的 Info 类用。
如果遇到需要判断 Info 类是否相等时,就需要写转换类,或手动增加这两个方法。
既然这样,何不自动生成?反正就算不使用也不会有什么影响。

为了简洁方便,用了 built_value 中的 hashCode 生成函数,略不妥。
我对 python 不太熟悉,所以 pr 中的代码纯粹是依葫芦画瓢,若合并,望检查。

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.

1 participant