[New-bugs-announce] [issue43473] Junks in difflib

Hubert Bonnisseur-De-La-Bathe report at bugs.python.org
Thu Mar 11 04:37:51 EST 2021


New submission from Hubert Bonnisseur-De-La-Bathe <hubertbdlb at gmail.com>:

Reading first at the documentation of difflib, I thought that the use of junks would have produced the result 

s = SequenceMatcher(lambda x : x == " ", "abcd efgh", "abcdefgh")
s.get_matching_blocks()
>>> [Match(a=0, b=0, size=8)]

At a second lecture, it is clear that such evaluation will return in fact two matches of length 4.

Would it be nicer to have get_matching_block return the length 8 match ? 

Don't know if it's in the spirit of the lib, I'm just asking.

----------
assignee: docs at python
components: Documentation
messages: 388491
nosy: docs at python, hubertbdlb
priority: normal
severity: normal
status: open
title: Junks in difflib
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43473>
_______________________________________


More information about the New-bugs-announce mailing list