Re: Extra base class in hierarchy

2016-11-19 Thread Gregory Ewing
Ian Kelly wrote: Is it better to introduce an extra base class? That's one possibility. An advantage would be that it would be easier to add methods in the future that apply to UsualTreeNodes but not FinalTreeNodes. Another possibility would be to just rename the classes. Instead of FinalTreeN

Re: Extra base class in hierarchy

2016-11-19 Thread Ian Kelly
On Nov 19, 2016 11:22 AM, "Victor Porton" wrote: Consider class FinalTreeNode(object): def childs(self): return [] class UsualTreeNode(FinalTreeNode) def childs(self): return ... In this structure UsualTreeNode derives from FinalTreeNode. This looks odd because "final

Extra base class in hierarchy

2016-11-19 Thread Victor Porton
Consider class FinalTreeNode(object): def childs(self): return [] class UsualTreeNode(FinalTreeNode) def childs(self): return ... In this structure UsualTreeNode derives from FinalTreeNode. Is it better to introduce an extra base class? class BaseTreeNode(object): d