Use generator for has().