hi. I'm using selectolax. but in many algorithms, we need to store nodes in a dict. but the parser.Node or lexbor.Node is not hashable so I cannot to use it. and in many algorithms we need to assign a unique id to any node of tree.
also there is a another problem
for example :
node = parent.child[0] # thats pseudo-code
node.parent is parent # return False
# but
node.parent == parent # return True
so there is no way to use id(.) if node as a unique feature of node to store it in a dict,
I cast the pointer of node to mem_id as mem_id and use mem_id as hash function.
so the problem is almost solved
hi. I'm using selectolax. but in many algorithms, we need to store nodes in a dict. but the parser.Node or lexbor.Node is not hashable so I cannot to use it. and in many algorithms we need to assign a unique id to any node of tree. also there is a another problem for example :
so there is no way to use id(.) if node as a unique feature of node to store it in a dict, I cast the pointer of node to mem_id as mem_id and use mem_id as hash function. so the problem is almost solved