PEP 484 -- Type Hints | Python.org
class Tree: def __init__(self, left: 'Tree', right: 'Tree'): self.left = left self.right = right
うーん・・・。
PEP 563 -- Postponed Evaluation of Annotations | Python.org
from __future__ import annotations
まぁ・・・。
PEP 484 -- Type Hints | Python.org
class Tree: def __init__(self, left: 'Tree', right: 'Tree'): self.left = left self.right = right
うーん・・・。
PEP 563 -- Postponed Evaluation of Annotations | Python.org
from __future__ import annotations
まぁ・・・。