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

In this example, calling sum() creates a generator and returns it. Say g = sum(). If you share g between threads, they will all use the same generator object! If you call sum() separately per thread, they will be different generators.

If you try to send g to a different process, you will get an error, because it doesn't serialize.



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

Search: