Message280737
| Author |
martin.panter |
| Recipients |
martin.panter, ncoghlan, njs, vstinner, yselivanov |
| Date |
2016年11月14日.07:38:49 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1479109130.03.0.503959236573.issue28629@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Perhaps I shouldn’t have mentioned "del gen". That was meant to represent the garbage collector running and calling gen.__del__() or equivalent. Basically what I was trying to say is I think there will be two classes of generators:
1. Simple generators just implementing the plain iterator protocol, where there is nothing to clean up. In these cases a ResourceWarning is unwanted. Example: generator expressions.
2. Complex generators that have special cleanup code. Ideally the user should either exhaust the generator or call its close() method, and a ResourceWarning would be useful if neither of these happen. Example: Nick’s mygen(). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年11月14日 07:38:50 | martin.panter | set | recipients:
+ martin.panter, ncoghlan, vstinner, njs, yselivanov |
| 2016年11月14日 07:38:50 | martin.panter | set | messageid: <1479109130.03.0.503959236573.issue28629@psf.upfronthosting.co.za> |
| 2016年11月14日 07:38:50 | martin.panter | link | issue28629 messages |
| 2016年11月14日 07:38:49 | martin.panter | create |
|