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

There's also:

  while data := fh.read(131072):
    # do stuff
which is a lot nicer than:

  while True:
    data = fh.read()
    if not data: break
    # do stuff


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

Search: