SequenceMatching without indents?

Aaron Bentley aaron.bentley at utoronto.ca
Tue Jul 11 02:38:30 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

+        else:
+            return DotsProgressBar(to_file=to_file, **kwargs)
     else:
- -        return DotsProgressBar(to_file=to_file, **kwargs)
- -

I hate bogus matches like this.  I'd rather see

+        else:
+            return DotsProgressBar(to_file=to_file, **kwargs)
+     else:
+ <more stuff>...
- -     else:
- -        return DotsProgressBar(to_file=to_file, **kwargs)

What if we stripped leading indents before generating the sequence, then
 checked whether matches were true before emitting them as matches?

e.g.

a
b
c
d

a
  b
c
b
e

would initially match as [(0, 0, 3)], but that would be converted to
[(0, 0, 1), (2, 2, 1)]

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEswEW0F+nu1YWqI0RAmMHAJsGDGZITG//jTPo6SnlMHet6L/djgCff0CP
8yCoekB6mC3IKK3SS1GzKPE=
=ihe3
-----END PGP SIGNATURE-----




More information about the bazaar mailing list