0
I’m passing a java code to python and came across it(cutting a few parts)
public class TreeNode {
public TreeNode(TreeNode pai) {
how do I receive the father of the type Treenode in python?
class TreeNode:
def __init__(self, pai: TreeNode):
that of the "Unresolved Re-reference 'Treenode' what way to do this?
What exactly would be "father of the type"? Do you need to reference the class itself? Remember that Python, unlike Java, has dynamic typing, so it makes no sense for you to define a type in the argument - and even if you do it will not interfere with the execution of the code; it will only be a annotation type. See more on Python 3: Attribute Types
– Woss