a1476c0414ad1e1412515c53d9e1f27b69039ead,allennlp/data/fields/index_field.py,IndexField,__eq__,#IndexField#Any#,55
Before Change
return self.sequence_index == other
// Otherwise it has to be the same object
else:
return id(other) == id(self)
After Change
// Allow equality checks to ints that are the sequence index
if isinstance(other, int):
return self.sequence_index == other
return super().__eq__(other)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances Project Name: allenai/allennlp
Commit Name: a1476c0414ad1e1412515c53d9e1f27b69039ead
Time: 2019-07-18
Author: eswallace@comcast.net
File Name: allennlp/data/fields/index_field.py
Class Name: IndexField
Method Name: __eq__
Project Name: pantsbuild/pants
Commit Name: 725fdaf504237190f6787dda3d72c39010a4c574
Time: 2020-07-26
Author: john.sirois@gmail.com
File Name: src/python/pants/engine/collection.py
Class Name: Collection
Method Name: __eq__
Project Name: facebookresearch/pytext
Commit Name: daae0c339eacbe13cffa8077125399f389d16cc8
Time: 2019-07-24
Author: snl@fb.com
File Name: pytext/data/utils.py
Class Name: SpecialToken
Method Name: __eq__
Project Name: allenai/allennlp
Commit Name: 78ee3d8532b2ec5522cce205c7221be15810ba4a
Time: 2019-08-29
Author: mattg@allenai.org
File Name: allennlp/data/fields/span_field.py
Class Name: SpanField
Method Name: __eq__