Message258017
| Author |
gvanrossum |
| Recipients |
benhoyt, gvanrossum, serhiy.storchaka, vstinner |
| Date |
2016年01月11日.21:08:07 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1452546487.15.0.536345791142.issue25994@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Note there's also a nasty corner case related to generators and GC. If a generator contains a with-block or finally-clause, and the generator is not run until its end because the caller hit an exception on one of the items returned, and the generator object is somehow kept alive (either because it's stored in some longer-living state or because the Python implementation doesn't use reference counting) then the close() call in the finally-clause or in the __exit__ method doesn't run until the generator object is garbage-collected.
IOW even making it a context manager doesn't completely solve this issue (though it can certainly help). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年01月11日 21:08:07 | gvanrossum | set | recipients:
+ gvanrossum, vstinner, benhoyt, serhiy.storchaka |
| 2016年01月11日 21:08:07 | gvanrossum | set | messageid: <1452546487.15.0.536345791142.issue25994@psf.upfronthosting.co.za> |
| 2016年01月11日 21:08:07 | gvanrossum | link | issue25994 messages |
| 2016年01月11日 21:08:07 | gvanrossum | create |
|