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

Indeed. I prefer the following variant which is more explicit and thus (IMHO) more in the spirit of Python:

   (varname,) = [x for x in l if predicate_with_single_truth_value(x)]


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

Search: