if l is None: return r
elif r is None: return l
elif l is None and r is None: return None
else: return l & r

=> fulltext() should never return False. It should either return an S3ResourceQuery or None.