Author daniel.urban
Recipients daniel.urban, rhettinger, stutzbach
Date 2011-02-26.12:24:32
SpamBayes Score 2.02955e-05
Marked as misclassified No
Message-id <>
Currently instances of classes which inherit an ABC in 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  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:34daniel.urbansetrecipients: + daniel.urban, rhettinger, stutzbach
2011-02-26 12:24:34daniel.urbansetmessageid: <>
2011-02-26 12:24:33daniel.urbanlinkissue11333 messages
2011-02-26 12:24:33daniel.urbancreate