> Right again. The simplest rule to remember seems to be "don't use yield or > yield-from inside a with-statement". You can relax it by limiting it to > context managers that manage any kind of shared resource, but that is > probably already too subtle: e.g. yielding inside "with open(file) as f" > seems fine, but yielding inside "with lock" is problematic, since the other > side might try to acquire the same lock, and deadlock. > This seems like the kind of thing that might warrant a pylint warning. Probably the more general case, requiring people to think about it and suppress the warning with an explanatory comment (or write the code in a different manner) when they are doing something known to be safe. -gps -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20131017/0ec4c985/attachment-0001.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4