Code review comment for lp:~allenap/launchpad/initseries-for-one-night-only-bug-793620

Revision history for this message
Gavin Panella (allenap) wrote :

I hadn't seen AfterPreprocessing before, neat :)

However, AfterPreprocessing only processes the matchee, not the
matcher, so that lambda doesn't ignore whitespace in the same way as
EqualsIgnoringWhitespace does. In that respect I think
EqualsIgnoringWhitespace is less surprising.

Having said that, EqualsIgnoringWhitespace doesn't actually *ignore*
whitespace, it just treats any run of whitespace as equal in matcher
and matchee. It's misnamed, but I don't think people are going to be
surprised by its behaviour anyway.

The reason for the (str, unicode) guard is so that the assertion
doesn't fail with an AttributeError (i.e. '...' object has no
attribute 'split') when the matcher or, more significantly, the
matchee are None or some other unexpected result.

« Back to merge proposal