Message158540
> I _think_ the only python related things you can do from tp_clear() is
> Py_DECREF(), this is what I mean by trivial.
Well, Py_DECREF is not trivial at all, since it can invoke arbitrary
Python code (through e.g. weakref callbacks, or by releasing the GIL).
Therefore, I would say any code is allowed from tp_clear :-)
> If file.close() can be an arbitrary python method, then it can no more
> be called from gc, than an object's __del__ method. This would not be
> a regression, this would be a fact of life.
I don't believe it. I don't see what's magical about being called by the
gc. Again, a Py_DECREF in tp_dealloc can invoke arbitrary Python code. |
|
Date |
User |
Action |
Args |
2012-04-17 10:48:31 | pitrou | set | recipients:
+ pitrou, tim.peters, loewis, rhettinger, amaury.forgeotdarc, kristjan.jonsson, dstanek, stutzbach, asvetlov, Jim.Jewett |
2012-04-17 10:48:30 | pitrou | link | issue9141 messages |
2012-04-17 10:48:30 | pitrou | create | |
|