This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients drevicko, rhettinger, terry.reedy, tim.peters
Date 2014-06-21.04:43:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403325789.99.0.85033711467.issue21635@psf.upfronthosting.co.za>
In-reply-to
Content
> What behavior both looks wrong and gets improved by the change?

The incorrect behavior is that matching_blocks is incorrectly cached so that calls to get_matching_blocks() returns an answer without the named tuple (in contravention of the documented behavior):

>>> s = SequenceMatcher(None, "abxcd", "abcd")
>>> s.get_matching_blocks()
[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
>>> s.get_matching_blocks()
[(0, 0, 2), (3, 2, 2), (5, 4, 0)]
>>> s.get_matching_blocks()
[(0, 0, 2), (3, 2, 2), (5, 4, 0)]
History
Date User Action Args
2014-06-21 04:43:10rhettingersetrecipients: + rhettinger, tim.peters, terry.reedy, drevicko
2014-06-21 04:43:09rhettingersetmessageid: <1403325789.99.0.85033711467.issue21635@psf.upfronthosting.co.za>
2014-06-21 04:43:09rhettingerlinkissue21635 messages
2014-06-21 04:43:09rhettingercreate