Message280737
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(). |
|
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 | |
|