When self-referencing inside a class, it is possible in Python to do
from typing import Self
class Node:
neighbor: Self
Currently, referencing the Node-class directly is different in Python (neighbor: 'Node') and Codon (neighbor: Node) so I thought it would be nice to use Self, so the script could run on both Python and Codon.
When self-referencing inside a class, it is possible in Python to do
Currently, referencing the
Node
-class directly is different in Python (neighbor: 'Node'
) and Codon (neighbor: Node
) so I thought it would be nice to useSelf
, so the script could run on both Python and Codon.Could the
typing
-mock be extended withSelf
?