Nicer way to set re-initialize classes after changing their bases.
1) Do not use gc.get_referrers as this is highly inefficient. (the returned list contains a lot of objects, some of them are persistent objects, some of them are not classes, etc, etc... But worse, "dead" objects with a zero reference count can be returned by this function, and this function would "ressucitate" them. gc.get_referrers for application code is usually a bad idea) 2) Use instead a Python metaclass to track who's been subclassing a portal type class, and after a change on the portal type class, we just call the efficient PortalTypeMetaClass.getSubclassList to get descendants. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39751 20353a03-c40f-0410-a6d1-a30d3c3de9de
Showing
Please register or sign in to comment