I have a function, create, which accepts these arguments:
create(self, name, val={})
It is part of a class which has an attribute also named val, so note that val
and self.val
are two different objects.
Somehow, the value of val
has been replaced with self.val
, which is leading to some recursion issues in my module.
The module in question, named pyndb, basically takes a dictionary and represents each key with a custom Node
object. These objects then do the same process (if the key's value is another dictionary) for all of the keys they hold. If it helps, I've documented the whole module here.
If you take a look at the module and the specific process to reproduce this error as I detail here, you will notice that this only occurs when trying to create the 3rd object inwards of the main class. The value of said object should be an empty dictionary, as I did not change the default value of the val
argument. However, if I set val
to an empty dictionary manually, there are no issues.
The part that stumps me the most is why this only affects the 3rd Node
inwards.
The source code for the module is in the GitHub repository which I linked above, and the module is available for install with pip:
pip3 install pyndb
Any help would be greatly appreciated.