You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
difflib.SequenceMatcher stores matching blocks as tuples, not Match named tuples #65834
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/rhettinger'closed_at=<Date2014-06-21.19:05:02.773>created_at=<Date2014-06-02.10:03:56.123>labels= ['type-bug', 'library']
title='difflib.SequenceMatcher stores matching blocks as tuples, not Match named tuples'updated_at=<Date2014-06-21.19:05:02.772>user='https://bugs.python.org/drevicko'
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):
Activity
drevicko commentedon Jun 2, 2014
difflib.SequenceMatcher.get_matching_blocks() last lines:
should be something like:
terryjreedy commentedon Jun 7, 2014
Why do you think this is a bug? What behavior both looks wrong and gets improved by the change?
rhettinger commentedon Jun 21, 2014
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):
python-dev commentedon Jun 21, 2014
New changeset f02a563ad1bf by Raymond Hettinger in branch '2.7':
bpo-21635: Fix caching in difflib.SequenceMatcher.get_matching_blocks().
http://hg.python.org/cpython/rev/f02a563ad1bf
python-dev commentedon Jun 21, 2014
New changeset ed73c127421c by Raymond Hettinger in branch '3.4':
bpo-21635: Fix caching in difflib.SequenceMatcher.get_matching_blocks().
http://hg.python.org/cpython/rev/ed73c127421c