• Yuya Nishihara's avatar
    grep: fix hash(linestate) to not include linenum · e47385ef4e17
    Yuya Nishihara authored
    linestate.__eq__() just compares the line values whereas __hash__() does
    hash both self.line and self.linenum, which violates the rule. __hash__()
    was added at fb502719c75c, "python 2.6 compatibility: add __hash__ to
    classes that have __eq__" with no additional remarks, so this would probably
    be a simple mistake.
    
    The test output changed because difflib.SequenceMatcher() internally uses
    a dict. As you can see, the line "export" is unchanged at the revision 2,
    so the new output is correct.
    e47385ef4e17
commands.py 253 KB