From: Andre W. <wo...@dp...> - 2003-12-30 11:08:48
|
Hi Jörg, On 29.12.03, Joerg Lehmann wrote: > > def merge(self, attrs): > > return attr.sortbeforeattr.merge(self, attr.exclusiveattr.merge(self, attrs)[:-1]) > > Hmm, this assumes implicitly that attr.exclusiveattr.merge returns self as > last element in the list -- which is currently the case. Well, it should be the last element since it doesn't modify the order of the attributes but removes unneeded entries (which come before the last element). But you're right, its quite implicit ... I mean, when I realized (again), that a new merge method is needed when we use both, exculsiveattr and sorfbeforeattr, I was already sure we want to have it once and for all. > > We may add a combined exclusive and sort attr because we do have this > > merge code several times in the attributes already ... what do you > > think? > > Taking into account the problem mentioned above, I think this is a > good idea. So what about a sortbeforeexclusiveattr class? If there > are no objections, I'll go ahead and implement this. Ok, please do so. It should be straigt forward. The name you suggested is kind of lengthly, but I think, its ok for that task, since its really part of the internal attribute system ... (and multiple inheritance of both parts was even longer to type not even taking into account the merge method). André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |