Message187409
| Author |
ncoghlan |
| Recipients |
ncoghlan |
| Date |
2013年04月20日.06:38:20 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1366439901.03.0.82185599108.issue17800@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
This came up in issue 17468: currently, populating tp_del from C (as generators now do) doesn't automatically create a __del__ wrapper visible from Python.
The rationale given in the initial commit is that there's no need to define a wrapper, since tp_del won't be populated from C code (that will use tp_dealloc instead), but there's now at least one case where it *is* populated from C (generators), which means it behaves *as if* __del__ is defined (since the interpreter actually checks the tp_del slot), but *looks* like __del__ *isn't* defined (since there is no wrapper created).
Independent of the memory leak concerns with generators defining tp_del, it would be better if a wrapper function was defined so the existence of the method was at least visible from Python code. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年04月20日 06:38:21 | ncoghlan | set | recipients:
+ ncoghlan |
| 2013年04月20日 06:38:21 | ncoghlan | set | messageid: <1366439901.03.0.82185599108.issue17800@psf.upfronthosting.co.za> |
| 2013年04月20日 06:38:20 | ncoghlan | link | issue17800 messages |
| 2013年04月20日 06:38:20 | ncoghlan | create |
|