Convert validation.assert_list isinstance checking to be lazy
Review Request #2228 - Created May 15, 2015 and submitted
|dturner-tw, jsirois, kwlzn, nhoward_tw|
Single line alteration - pants.base.validation.assert_list is called frequently and I added laziness to avoid unneccesary function calls. Saw this when profiling and wanted to fix it despite it not being a huge win...
I also added unit tests for this function which doesn't appear to be directly unit before this.
Pull request https://github.com/pantsbuild/pants/pull/1550 runs the Travis CI suite and it all passes.
I can't seem to run the ci script myself but I did run all the unit tests which pass and verified that the new test_validation target was included in the tests that run. One of the tests demonstrates the lazyness of the new version.
It is pretty great to submit a new test class with a one-line patch. This is a drive-by comment to give a ReviewBoard heads-up.
I saw this in the queue but I don't think there are any current Pants committers in the People tab. You should probably add a few other people to the People group (git log suggests David Turner, jsirois and nhoward).
Additionally, using your Twitter email address gives RB a hard time with sending emails to pants-reviews. The group won't generally see a review from a @twitter.com email address unless a committer comments on the review itself. If you have future patches in mind, I think that the usual solution is to register with a @twopensource address.