Message129534
Currently instances of classes which inherit an ABC in collections.abc will have a __dict__. This can be a problem for example a tree-like data structure. It would make sense to inherit for example MutableMapping, but that would possibly mean, that every node in the tree would have a __dict__, which is probably a waste of memory.
A workaround for this problem is not inheriting the ABC, and using ABCMeta.register (and optionally adding the mixin methods explicitly), but this feels like a hack.
The attached patch adds an empty __slots__ to the ABCs in collections.abc. I excluded the mapping views (MappingView, KeysView, ItemsView and ValuesView), because they can't have an empty __slots__, and I think using a nonempty __slots__ possibly can cause problems in some cases with multiple inheritance. |
|
Date |
User |
Action |
Args |
2011-02-26 12:24:34 | daniel.urban | set | recipients:
+ daniel.urban, rhettinger, stutzbach |
2011-02-26 12:24:34 | daniel.urban | set | messageid: <1298723074.18.0.581998347487.issue11333@psf.upfronthosting.co.za> |
2011-02-26 12:24:33 | daniel.urban | link | issue11333 messages |
2011-02-26 12:24:33 | daniel.urban | create | |
|