在python中复制struct

Abh*_*rle 2 python struct

反正是否支持python中的结构并且它不支持普通的关键字struct

例如:

struct node
{
  unsigned dist[20];
  unsigned from[20];
}rt[10];
Run Code Online (Sandbox Code Playgroud)

我如何将其转换为python结构?

Sam*_*uns 8

我认为Python相当于C-structs classes:

class Node:
    def __init__(self):
        self.dist_ = []
        self.from_ = []

rt = []
Run Code Online (Sandbox Code Playgroud)