生成 "operator ==" 和 "hashCode" 方法 #19
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在开发中,生成的代码有时候直接拿来当做程序中的 Info 类用。
如果遇到需要判断 Info 类是否相等时,就需要写转换类,或手动增加这两个方法。
既然这样,何不自动生成?反正就算不使用也不会有什么影响。
为了简洁方便,用了 built_value 中的 hashCode 生成函数,略不妥。
我对 python 不太熟悉,所以 pr 中的代码纯粹是依葫芦画瓢,若合并,望检查。