Serhiy Storchaka wrote:
but should not affect performance since locking is used only when you faced with a generator running in other thread.

I don't think that's true, because the first thread to use a
generator has to lock it as well. And even if there is only
one thread in existence when __next__ is called, another one
could be created before it finishes and try to use the
generator.

--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to