Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The poster is basically proposing something like always doing:

  def all(lis: List[T], mapf: Callable [[T], bool]) -> bool:
    for e in (mapf(l) for l in lis):
       if e is False: return False
    return True
At least that's my take on avoiding Truthy and Falsy via a mapping closure (or function?). But I don't see it solving OPs issue here when lis is empty... So maybe I'm missing something too.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: