Not sure if that will work, since groups is a generator (or a 2d array) which is not falsy.