Note that this crosses the `itertoolz`/`functoolz` boundary, hence the internal import.  I'm not sure what should be done here.  Perhaps this should be moved downstream.