caesar0301 / treelib

An efficient implementation of tree data structure in python 2/3.
http://treelib.readthedocs.io/en/latest/
Other
800 stars 185 forks source link

Node.__init__() now accepts **kwargs, and calls super().__init__() #190

Closed christian-krieg closed 2 years ago

liamlundy commented 2 years ago

Adding super().__init__() seems fine although unnecessary, but object doesn't take any parameters and will fail if you try to utilize **kwargs here

christian-krieg commented 2 years ago

Should have mentioned this in the first place; Calling super.__init__() is necessary for multi-inheritance; if you derive a class from Node and another class, both super-classes need to call super.__init__().

liamlundy commented 2 years ago

Should have mentioned this in the first place; Calling super.__init__() is necessary for multi-inheritance; if you derive a class from Node and another class, both super-classes need to call super.__init__().

Since Node only inherits from object that shouldn't be the case. Can you send an example of what you are trying to solve? There are also some issues and PRs trying to make Node subclassable that should handle the implementation details.