Message282486
> * Somehow, notify Foo that Meta has a reference to its cache, so Foo is able to invalidate Meta cache
This was implemented when the type cache was implemented in Python 2.6, but only for explicit subclasses. PyType_Modified() iterates on tp_subclasses.
PyType_Ready() updates tp_subclasses: it stores a weak reference to sub classes in each base class.
I understand that, if we want to implement this feature, type_mro_modified() should be modified to add a backward reference in each base class of the MRO. type_mro_modified() is called when a type is defined, but also when type.__bases__ is explicitly modified.
It would require to add a new slot to types, and so increase a little bit the memory usage, and slow down the creation of a type, and type.__bases__ (slow down: probably negligible, O(1) since the existing tp_subclasses uses a dict). |
|
Date |
User |
Action |
Args |
2016-12-05 23:30:05 | vstinner | set | recipients:
+ vstinner, serhiy.storchaka, abarry, mdk, sjpalt |
2016-12-05 23:30:05 | vstinner | set | messageid: <1480980605.43.0.715585163766.issue28866@psf.upfronthosting.co.za> |
2016-12-05 23:30:05 | vstinner | link | issue28866 messages |
2016-12-05 23:30:05 | vstinner | create | |
|